I'm learning how to pass parameters to a Crystal Report from a C# asp.net webform. I've found one way to pass parameters, but its 6 lines of code per parameter. Can anyone suggest a simpler way to pass parameters (both discrete and range) to the report?
Here's a question and answer I had that addresses this question:
Out of the code that I posted in the answer, here's what I think is relevant to your problem:
private readonly CrystalReportViewer reportViewer = new CrystalReportViewer();
...
crystalReport.Load(this.reportViewer.ReportSource.ToString());
crystalReport.SetParameterValue("customerId", customerId);
crystalReport.SetParameterValue("isCurrent", isCurrent);
crystalReport.SetParameterValue("TotalSales", totalSales);
Good luck!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.