2012-09-12 45 views
0

我有一份報告,它在正常運行時會返回正確的數據,但是當我通過報告執行服務運行時,報告不包含任何數據。我們確實傳入了一個參數,其中包含我們過濾的ID,使用報告上的標籤可以驗證它正在發送。SSRS 2005報告執行服務不返回結果

如果我看一下ExecutionLogStorage表,我可以看到我的報告運行時狀態爲rsSuccess,但RowCount爲0.在事件日誌或報告服務器日誌中沒有錯誤。

下面是我們使用的報表等PDF的方法:

public byte[] Render(ReportRequest rptRequest) 
    { 
     ReportExecutionService rs = new ReportExecutionService(); 

     rs.Credentials = CredentialCache.DefaultCredentials; 
     rs.Url = rptRequest.ReportExecutionServerEndPoint; 

     string reportPath = string.Format(
      "/{0}/{1}", 
      rptRequest.ReportDataBaseName, 
      rptRequest.ReportName); 

     string format = "PDF"; 

     string historyID = null; 
     string devInfo = 
      @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"; 

     string encoding; 
     string mimeType; 
     string extension; 
     Warning[] warnings; 
     string[] streamIDs; 

     ExecutionHeader execHeader = new ExecutionHeader(); 

     rs.ExecutionHeaderValue = execHeader; 
     rs.LoadReport(reportPath, historyID); 

     rs.SetExecutionParameters(rptRequest.ReportParameters, "en-us"); 

     return rs.Render(
      format, 
      devInfo, 
      out extension, 
      out encoding, 
      out mimeType, 
      out warnings, 
      out streamIDs); 
    } 

回答

1

原來的代碼是根據不同的用戶帳戶下運行,當它被部署。該帳戶沒有權限讀取任何數據。