ljhodgett
asked on
Error when passing parameters to Crystal Reports
Hi Experts,
I have the following code: -
Dim dr As DataRow = DSTPurchaseOrder.Tables(0) .NewRow
dr(0) = "1"
dr(1) = "2"
dr(2) = "3"
dr(3) = "4"
dr(4) = "Another"
dr(5) = "6"
dr(6) = "7"
dr(7) = "8"
DSTPurchaseOrder.Tables(0) .Rows.Add( dr)
rpt.SetParameterValue("Com pany Name", txtCompanyName.Text)
rpt.Load(Forms.Application .StartupPa th & "\PurchaseOder.rpt")
rpt.SetDataSource(DSTPurch aseOrder.T ables(0))
CrystalReportViewer1.Repor tSource = rpt
I am trying to populate a crystal report using vb.net 2005 with crystal reports bundelled with it. When the for loads despite me adding a paramter name “Company Name” when I send data to it it does not seem to work as when the report loads it says: -
Enter Parameter Values.
You can provide a single value for this paramter. Enter the value you want to include for “Company Name”
What am I doing wrong please. Sorry I am new to crystal reports.
Many Thanks
Lee
I have the following code: -
Dim dr As DataRow = DSTPurchaseOrder.Tables(0)
dr(0) = "1"
dr(1) = "2"
dr(2) = "3"
dr(3) = "4"
dr(4) = "Another"
dr(5) = "6"
dr(6) = "7"
dr(7) = "8"
DSTPurchaseOrder.Tables(0)
rpt.SetParameterValue("Com
rpt.Load(Forms.Application
rpt.SetDataSource(DSTPurch
CrystalReportViewer1.Repor
I am trying to populate a crystal report using vb.net 2005 with crystal reports bundelled with it. When the for loads despite me adding a paramter name “Company Name” when I send data to it it does not seem to work as when the report loads it says: -
Enter Parameter Values.
You can provide a single value for this paramter. Enter the value you want to include for “Company Name”
What am I doing wrong please. Sorry I am new to crystal reports.
Many Thanks
Lee
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't know. That was basically a guess.
I suspect resetting the data source may reswet the parameters.
mlmcc
I suspect resetting the data source may reswet the parameters.
mlmcc
Glad i could help
mlmcc
mlmcc
ASKER
Thank you for that I'll accept your answer. Out of curiosity why does it have to be set after the datasource.
Many Thanks
Lee