c# - 如何将参数从 ASP.NET 传递到 SSRS 报告?

标签 c# asp.net reportingservices-2005

我需要将一个值作为参数从 ASP.Net 应用程序传递到 SSRS 报告。我该怎么做?有人可以帮助我吗?

提前致谢。

最佳答案

按照下面的行试一试...

        ReportViewer1.ServerReport.ReportServerUrl = new System.Uri("http://MyPC/reportserver");
        ReportViewer1.ServerReport.ReportPath = "/ReportFolder/Reportname";

        Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[3];
        Param(2) = new Microsoft.Reporting.WebForms.ReportParameter("SDATE", "02/02/2002");
        Param(1) = new Microsoft.Reporting.WebForms.ReportParameter("EDATE", "09/06/2000");
        Param(0) = new Microsoft.Reporting.WebForms.ReportParameter("TASK", 0);

        View.ReportViewer.ShowParameterPrompts = false;
        View.ReportViewer.ServerReport.SetParameters(Param);
        View.ReportViewer.ServerReport.Refresh();

关于c# - 如何将参数从 ASP.NET 传递到 SSRS 报告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3155215/

相关文章:

c# - 将 XAML 窗口设置为始终位于顶部(但没有 TopMost 属性)

c# - 向 InfoPath XML 架构添加值

mysql - 如果另一个表具有空值(序列不包含元素),则查询不显示

connection-string - 在 SSRS2008 中使用动态连接字符串

reporting-services - RS2008 背景图像大小调整

c# - 将对结构的引用添加到 C# 列表中

c# - 自定义 ConfigurationSection 到外部 .config

javascript - 将参数从 ajax 函数传递到 aspx.cs 文件

c# - MVC : Add output cache for all actions

reporting - SSRS : Showing the correct execution time on a two page report?