2014-01-21 147 views
0

我已經在服務器中部署了我的SSRS報告。我可以從我的本地Web應用程序訪問該報告嗎?我已經在web.config中提供了服務器的憑據。但它仍然不顯示報告,並顯示一些錯誤,如Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection)從本地應用程序訪問SSRS服務器報告

當我在服務器託管相同的應用程序,它工作得很好。

誰能告訴我爲什麼我無法從我的本地系統訪問報告?

回答

1

這不是我的代碼,但最好是你所要做的。我記得在一段時間回來

private void ShowReport() 
{ 
    try 
    { 
     string urlReportServer = "http://sqlDBServer//Reportserver"; 
     rptViewer.ProcessingMode = ProcessingMode.Remote; // ProcessingMode will be Either Remote or Local 
     rptViewer.ServerReport.ReportServerUrl = new Uri(urlReportServer); //Set the ReportServer Url 
     rptViewer.ServerReport.ReportPath = "/ReportName"; //Passing the Report Path     

     //Creating an ArrayList for combine the Parameters which will be passed into SSRS Report 
     ArrayList reportParam = new ArrayList(); 
     reportParam = ReportDefaultPatam(); 

     ReportParameter[] param = new ReportParameter[reportParam.Count]; 
     for (int k = 0; k < reportParam.Count; k++) 
     { 
      param[k] = (ReportParameter)reportParam[k]; 
     } 
     // pass crendentitilas 
     //rptViewer.ServerReport.ReportServerCredentials = 
     // new ReportServerCredentials("uName", "PassWORD", "doMain"); 

     //pass parmeters to report 
     rptViewer.ServerReport.SetParameters(param); //Set Report Parameters 
     rptViewer.ServerReport.Refresh(); 
    } 
    catch (Exception ex) 
    { 
     throw ex; 
    } 
} 

參考以往項目的一個成功地利用它:http://www.codeproject.com/Articles/675762/Call-SSRS-Reports-by-using-Csharp

相關問題