如何在ActiveReports报告中传递我的SQL查询所需的参数?我知道about the code that goes into the ReportStart event,但是如何将参数值传递给报告?
弄清楚了 . 从您的运行报告的 class :
var report = new MyReport(); report.Parameters["Parm1"].PromptUser = false; report.Parameters["Parm1"].Value = someVariable; report.Parameters["Parm2"].PromptUser = false; report.Parameters["Parm2"].Value = someVariable2.ToString("M-d-yyyy"); report.Run();
显然,当一个新增报表时,会对参数进行解析,并将它们添加到Parameters集合中 . 所以你只需要按照自己的意愿设置属性 .
还有另一种方法,请点击此处 . http://www.daniweb.com/software-development/csharp/threads/230041/active-reports-passing-variable-to-ar-class
2 回答
弄清楚了 . 从您的运行报告的 class :
显然,当一个新增报表时,会对参数进行解析,并将它们添加到Parameters集合中 . 所以你只需要按照自己的意愿设置属性 .
还有另一种方法,请点击此处 . http://www.daniweb.com/software-development/csharp/threads/230041/active-reports-passing-variable-to-ar-class