0

I am trying to Call SSRS Report in WPF with Parameter Passing From WPF UI without using Microsoft Report Viewer Component. I Used the following Code for Passing Parameter to SSRS Report...

            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);

But, the Last Statement...

rpt.SetParameters(reportParameterCollection);

raise the following error...

The Best Overload method match for 'Microsoft.reporting.Winform.Report.Setparameters(Microsoft.Reporting.Winform.ReportParameter)' has Some Invalid Argument.

How Can I Solve this issue? Can Anyone help Me.? Thanks in advance...

Osman
  • 1,270
  • 2
  • 16
  • 40

1 Answers1

1

The SetParameters method requires an IEnumerable, not an array as you have

Paul Bambury
  • 1,252
  • 1
  • 13
  • 17