开发者

PDF Export issue in Reporting Services

开发者 https://www.devze.com 2022-12-08 00:40 出处:网络
I have come across an error when exporting a report to PDF in Reporting Services 2008. The error message is;

I have come across an error when exporting a report to PDF in Reporting Services 2008.

The error message is;

Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please re开发者_开发知识库view 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

However this error doesn't always appear on this report, it has only occurred on several occasions, dependent on the dates we use in the parameters of the report. I am new to Reporting Services so could anyone help me figure out what could be causing the problem?


Hide row logic cause this error. The hide row logic was referencing a value from a dataset not assign to the table. When I removed that hide logic it exported fine. To solve it I just wrote the hide logic differently to use only values from the tables dataset.


I've figured out what was causing this (in my case.) It was happening because one of the fields within the grid of my report contained commas and spaces. Each of these characters caused the dreaded 'object reference...' exception to be thrown. I used a REPLACE function in the stored proc that drives the report to replace commas and spaces with the pipe character. It is not a very graceful solution, so I'd be interested to hear if anyone else has ideas around this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消