2012-05-02 54 views
0

這裏我有一個windows應用程序和一個SSRS報告,其中報告在報告服務器中實現,並且我嘗試從Windows應用程序調用該報告。在我的按鈕中單擊我添加此代碼:在ReportServer中調用ReportService來自Windows應用程序

string reportName = "Crime_Traking_Report"; 
      reportViewer1.ServerReport.ReportServerCredentials =new ReportServerCredentials("isroScientist", "password12345678", "Nasa"); 
      reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote; 
      try 
      { 
       reportViewer1.ServerReport.ReportServerUrl = new Uri("http://13.88.91.156/ReportServer"); 
      } 
      catch (UriFormatException) 
      { 
       Console.WriteLine("Bad Url format"); 
      } 
      reportViewer1.ServerReport.ReportPath = "/iSROReportsStandard/" + reportName; 
      reportViewer1.ProcessingMode = ProcessingMode.Remote; 
      reportViewer1.ServerReport.Refresh(); 

這裏肯定我想通過憑據來訪問,但是當我運行我的應用程序它給出了這樣的錯誤「ReportServerCredentials沒有構造函數定義」,我想做什麼改變,以便成功地通過憑證我的code.please通過代碼解釋我。

回答

相關問題