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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Here's a question and answer I had that addresses this question:
Crystal Reports "File Break"
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!
回答2:
You might want to have a look at http://www.fetal.de/en/crystal-reports-ohne-den-enter-parameter-values-dialog