ChubbyArse
Programmer
Hi All,
I'm attempting, to set the datasource for a report and a subreport on it. I designed the the reports using two XML files, which were generated from .Net datatables.
At runtime, I'm using this code to change the datasource of the two reports, to use datatables (which has been created previously):
(The reports use a different datatable each).
When this is run I get the following error when I try to view the report in a reportviewer object.
Error in formula <Report_Selection>
"{Site_Services.CardNumber} = {?Pm-Service_Card_Standard.CardNumber}"
A number is required here.
The confusing thing is that in design mode in Crystal it runs fine, but when I try to dynamically change the datasources to a datatable it falls over.
Using the code
works fine when there is one report (no subreport).
Even with the subreport example above, the code runs, but the error occurs when I show the form which contains the report (in a reportviewer).
Thanks
Alex
I'm attempting, to set the datasource for a report and a subreport on it. I designed the the reports using two XML files, which were generated from .Net datatables.
At runtime, I'm using this code to change the datasource of the two reports, to use datatables (which has been created previously):
Code:
rpt = New rptServiceCardStandard
rpt.SetDataSource(dtReportData)
rpt.OpenSubreport("rptSiteServices_SubReport").SetDataSource(dtReportServices)
(The reports use a different datatable each).
When this is run I get the following error when I try to view the report in a reportviewer object.
Error in formula <Report_Selection>
"{Site_Services.CardNumber} = {?Pm-Service_Card_Standard.CardNumber}"
A number is required here.
The confusing thing is that in design mode in Crystal it runs fine, but when I try to dynamically change the datasources to a datatable it falls over.
Using the code
Code:
rpt.SetDataSource(dtReportData)
Even with the subreport example above, the code runs, but the error occurs when I show the form which contains the report (in a reportviewer).
Thanks
Alex