how to pass parameters from vb.net form to a crystal report sql query

tutu

Member
Joined
Apr 17, 2006
Messages
12
Location
india
Programming Experience
1-3
hi all,
i want to pass a bill no and client name from a vb.net form to a crystal report sql querry and generate report based on that bill no.please help
 
Create string parameters in the report named "BillNo" & "ClientName"
Use the parameters to build your record selection formula.

Whe you want to call the report, you pass the variables like this:

VB.NET:
Dim tBillNumber as String = Textbox1.text  
Dim tClientName as String = Textbox2.text     
Dim rpt As New CrystalReport2
rpt.SetParameterValue("BillNo", tBillNumber)
rpt.SetParameterValue("ClientName", tClientName)
Names and types must match, ie.. strings to strings.
If the bill number is an integer change both the report parameter and the form variable.
 
Back
Top