2012-11-14 14 views
0

我用下面的代碼有問題呈現報表渲染之前訪問報告XML內容:如何獲得使用報告執行服務

rsExecService.ReportExecutionService rsExec = this.CreateReportExecutionService(); 
rsExecService.ExecutionInfo ei = rsExec.LoadReport(path, historyID); 

Byte[] results; 
string mimeType = String.Empty; 
rsExecService.Warning[] warnings = null; 
string[] streamIDs = null; 

results = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); 

(有些變量定義缺失,因爲他們正在爲通過該方法的參數)。

問題是我需要在呈現之前對報告進行一些預處理,包括本地化。
我看了一下ExecutionInfo'ei',並且似乎沒有成員讓我訪問原始xml報告內容。

是否有另一種呈現報告的方式,可以讓我先改變xml?

ETA:請參閱下面的答案。

回答

3

我已經工作了:

  • 首先使用ReportingService2010下載使用 GetItemDefinition(路徑)的報告。
  • 對 原始數據進行任何預處理。
  • 代替使用ReportExecutionService.LoadReport(),請使用LoadReportDefinition()