【问题标题】:How to SET ReportParameter Value of SSRS Report in WPF如何在 WPF 中设置 SSRS 报表的 ReportParameter 值
【发布时间】:2016-08-23 12:34:39
【问题描述】:

我正在尝试通过从 WPF UI 传递参数而不使用 Microsoft Report Viewer 组件在 WPF 中调用 SSRS 报告。我使用以下代码将参数传递给 SSRS 报告...

            Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];       //Array size describes the number of paramaters.

            reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
            reportParameterCollection[0].Name = "OfficeCode";
            reportParameterCollection[0].Values.Add(cmbOfficeName.SelectedValue.ToString().Trim());
            rpt.SetParameters(reportParameterCollection);

但是,最后的陈述......

rpt.SetParameters(reportParameterCollection);

引发以下错误...

“Microsoft.reporting.Winform.Report.Setparameters(Microsoft.Reporting.Winform.ReportParameter)”的最佳重载方法匹配有一些无效参数。

我该如何解决这个问题?谁能帮我。?提前谢谢...

【问题讨论】:

    标签: .net wpf c#-4.0 reporting-services ssrs-2008-r2


    【解决方案1】:

    SetParameters 方法需要一个 IEnumerable,而不是你拥有的数组

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-02
      • 1970-01-01
      相关资源
      最近更新 更多