2009-10-15 113 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

隐藏行逻辑导致此错误。隐藏行逻辑引用了未分配给表的数据集中的值。当我删除隐藏逻辑它导出罚款。为了解决它,我只写了隐藏逻辑,以便仅使用表数据集中的值。