activereports - 从 .NET 代码向 ActiveReports 报告传递参数的最简单方法

标签 activereports

如何在 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/

相关文章:

.net - 将 HTML 内容格式化为可打印报告

c# - ActiveReports 和 RichTextBox 的问题

richtextbox - 在事件报告软件的富文本框中呈现 html

c# - Active Reports 9 : Multi-Colum SectionReport, 这可能吗?

c# - 如何调整 ActiveReports Designer 控件设计部分的大小?

asp.net - Visual Studio 2013 拒绝构建解决方案,显示 "Could not load file or assembly ... Failed to grant minimum permission requests"、 0x80131417

.net - 事件报告分组

windows-services - ActiveReports 7 抛出来自 Windows 服务的无效句柄异常打印