【问题标题】:Not able to pass parameter to SSRS report from c# Microsoft.Reporting.WebForms.ReportViewer无法从 c# Microsoft.Reporting.WebForms.ReportViewer 将参数传递给 SSRS 报告
【发布时间】:2020-02-07 19:50:35
【问题描述】:

从一个 aspx,我有调用 SSRS 报告的代码。大部分代码都有效,但现在尝试传递一个参数,它没有显示在报告本身中。有关调试此问题的后续步骤的任何想法?

public partial class GenerateReports 
{
    . . .
    protected global::Microsoft.Reporting.WebForms.ReportViewer rptViewer;
}

public partial class GenerateReports : System.Web.UI.Page
{
    . . .
    private void LoadReport(string reportName)
    {
        rptViewer.ServerReport.DisplayName = reportName;
        rptViewer.ServerReport.ReportPath = LodgexConfigurationManager.ItemPath + reportName;

        rptViewer.ServerReport.SetParameters(new ReportParameter("rptperiod", "1")); 

        rptViewer.ServerReport.Refresh();
    }
}

【问题讨论】:

  • 你可以试试rptViewer.ServerReport.SetParameters(new ReportParameter("rptperiod", 1));,因为它是整数而不是字符串。

标签: c# reporting-services ssrs-2012


【解决方案1】:

随着数组的工作,对 ReportParameter 的更改。

        rptViewer.ServerReport.SetParameters(new ReportParameter[] {
            new ReportParameter("ManifestPeriod", reportManifestPeriod)
        });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-02
    • 1970-01-01
    相关资源
    最近更新 更多