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.
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.
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.