2016-08-23 57 views
0

我正嘗試使用參數從WPF UI傳遞而不使用Microsoft Report Viewer組件來調用WPF中的SSRS報告。我用下面的代碼傳遞參數SSRS報告...如何在WPF中設置SSRS報告的ReportParameter值

  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)'的最佳重載方法匹配有一些無效參數。

我該如何解決這個問題?誰能幫我。?在此先感謝...

回答