Who can help me about parameter in crysatal report 8.5

zxm954712 2003-04-28 10:33:22
How do vb application pass the value to parameter in crystal report 8.5. I use the crystal report activex control. If this problem is solved , I give him 100 points immediately.
Thanks.
...全文
43 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zxm954712 2003-05-09
  • 打赏
  • 举报
回复
to frieder(楼高万丈, 挡的是不来的人):
I try this method, but a little bug: parameter prompt dialog will be displayed. Who can solve this problem so that this dialog will not be shown?

I know the crystal report view control CRViewer who has a property EnableParameterPrompting, But I don't know the crystal report control

thanks:)

black_snail 2003-05-09
  • 打赏
  • 举报
回复
you may use the formular to replace the parameter. First, create a new formular in the crystal report file, then you assign the value to the formular in vb application. For example, you should pass the customername to the rpt file:
1. create a new formular txtcustname
varstring txtcustname;

2. VB application code:
with crystalreport
.formular(0) = "@txtcustname=" & "'" & txtcustomername &"'"
end with

txtcustomername is a textbox control which is used to input the customer name.


edwinwyx 2003-05-04
  • 打赏
  • 举报
回复
I resolve the problem in bcb ,the following is step:

step one :
In Crystal 8.5,i define three Parameter Field:BeginDate,EndDate,AreaCode

step two :
I call the *.rpt file in bcb VCL ,the follwing is code :

.............................

Crpe1->ParamFields->Retrieve () ;

Crpe1->ParamFields->ItemIndex = 0 ;
Crpe1->ParamFields->Value = "2003-05-04 10:00:00" ;

Crpe1->ParamFields->ItemIndex = 1 ;
Crpe1->ParamFields->Value = "2003-05-04 10:59:59" ;

Crpe1->ParamFields->ItemIndex = 2 ;
Crpe1->ParamFields->Value = "深圳" ;

Crpe1->ParamFields->ItemIndex = 3 ;
Crpe1->ParamFields->Value = "小时报表" ;

// Change background colr for section
Crpe1->SectionFormat->Retrieve();
//Crpe1->SectionFormat->Item[1]->BackgroundColor = clRed;
Crpe1->SectionFormat->Section = "D";
Crpe1->SectionFormat->BackgroundColor = clGreen;

this->Crpe1->WindowParent = this ;
this->Crpe1->Selection->Formula->Add("{z_agent_hjqkb_hour.Fzxid}>1 and {z_agent_hjqkb_hour.Fzxid}<100") ;
this->Crpe1->Execute () ;
........................................

I wish it will help you !
edwinwyx 2003-04-30
  • 打赏
  • 举报
回复
I am also trouble with this problem ,If someone know pls answer ,i will give him
200 points immediately
frieder 2003-04-30
  • 打赏
  • 举报
回复
1)code VB in the following way (crystal 8.5):
With Me.CrystalReport1
.ReportFileName = crptSRC
.ParameterFields(0) = "refno;" & Me.MG1.Text & ";true"
.ParameterFields(1) = "cname;" & Form2.Text1(1).Text & ";true"
.ParameterFields(2) = "ename;" & Form2.Text1(2).Text & ";true"
.ParameterFields(3) = "receiver;" & Form2.Data2.Recordset!Receiver & ";true"
.ParameterFields(4) = "delivery;" & Form2.Data2.Recordset!Delivery & ";true"
.ParameterFields(5) = "origin;" & Form2.Data2.Recordset!Origin & ";true"
.DiscardSavedData = False
.Action = 1
End With

2)in Crystal 8.5:
define the corresponding parameter fields.

abiho 2003-04-30
  • 打赏
  • 举报
回复
详细点,行不?

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧