如何在 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();
显然,当一个新的 ups 报告时,它被解析以获取参数并将它们添加到 Parameters 集合中。因此,您只需要按照自己的意愿设置属性即可。
关于activereports - 从 .NET 代码向 ActiveReports 报告传递参数的最简单方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7854668/