2009-10-15 86 views
1

在Reporting Services的2008年PDF導出問題

的錯誤消息是導出爲PDF格式的報告時,我所遇到的錯誤;

Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[Exception: Object reference not set to an instance of an object.]

[Exception: An error occurred during rendering of the report.]

[Exception: An error occurred during rendering of the report.]
Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension) +520
Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) +963
Microsoft.Reporting.WebForms.ServerReport.Render(String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) +28
Microsoft.Reporting.WebForms.ServerModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileExtension) +85
Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +150 Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +183
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

但是這個錯誤並不總是出現在該報表上,它只是發生在幾個場合,依賴於我們在報告的參數使用的日期。我是Reporting Services新手,所以任何人都可以幫助我找出可能導致問題的原因?

+0

您如何導出報告?在你自己的代碼中?或來自或從報告服務網頁界面? – Mozy 2009-10-16 15:01:43

+0

我試圖從導出下拉框中手動從Reporting Services Web界面導出。 – Jezza69 2009-10-22 06:40:16

回答

0

我已經知道是什麼導致了這種情況(在我的情況下)。這是因爲我的報告網格中的一個字段包含逗號和空格。每個這些字符都會導致可怕的「對象引用...」異常被拋出。我在存儲過程中使用REPLACE函數來驅動報告,以用管道字符替換逗號和空格。這不是一個非常優美的解決方案,所以我很想聽聽有沒有人有關於這個問題的想法。

1

隱藏行邏輯導致此錯誤。隱藏行邏輯引用了未分配給表的數據集中的值。當我刪除隱藏邏輯它導出罰款。爲了解決它,我只寫了隱藏邏輯,以便僅使用表數據集中的值。