从 Reporting Services 渲染为 PDF 时出现错误

发布于 2024-08-14 02:54:40 字数 5761 浏览 6 评论 0原文

我在 MS 报告服务中有一份报告,在屏幕上呈现得很好(通过报告服务 Web 界面查看报告时),但是当我将其导出为 PDF 时,它会出错。

尝试通过 Web 服务访问报表时会显示以下 YSOD,但从报表服务 Web 界面呈现为 PDF 时也会出现报表错误。

关于如何找出导致此问题的原因有什么想法吗?

Server Error in '/****' Application.
--------------------------------------------------------------------------------

An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: 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.Web.Services.Protocols.SoapException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: 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: 


[SoapException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431678
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
   EZTrac.Infrastructure.Reporting.Services.Impl.ReportExecutionService.Render(String Format, String DeviceInfo, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac.Infrastructure.Reporting\Services\Impl\ReportExecutionService.cs:827
   EZTrac.Infrastructure.Reporting.Services.Impl.PaccarReportService.GetReport(IReport report) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac.Infrastructure.Reporting\Services\Impl\PaccarReportService.cs:75
   EZTrac.Controllers.ReportController.GenerateReport(IReport report) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac\Controllers\ReportController.cs:181
   EZTrac.Controllers.ReportController.GetReportFileStreamResult(ReportInputBase reportInput) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac\Controllers\ReportController.cs:174
   EZTrac.Controllers.ReportController.DealerTransactionReportDownload(DealerTransactionForm form) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac\Controllers\ReportController.cs:78
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +85
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
   System.Web.Mvc.Controller.ExecuteCore() +123
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3053 

编辑

看起来当报告非常大(不确定阈值是多少)时,PDF将无法呈现。 (40 多个 PDF 页会导致错误,但 5 个或更少页则不会出错)。

I have a report in MS reporting services that renders just fine to the screen (when viewing the report through the reporting services web interface), but when I go to export that to a PDF it errors.

The following YSOD is shown when trying to access the report via web services, but the report errors when rendering to PDF from the reporting services web interface as well.

Any ideas on how I can track down what is causing this issue?

Server Error in '/****' Application.
--------------------------------------------------------------------------------

An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: 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.Web.Services.Protocols.SoapException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: 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: 


[SoapException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431678
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
   EZTrac.Infrastructure.Reporting.Services.Impl.ReportExecutionService.Render(String Format, String DeviceInfo, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac.Infrastructure.Reporting\Services\Impl\ReportExecutionService.cs:827
   EZTrac.Infrastructure.Reporting.Services.Impl.PaccarReportService.GetReport(IReport report) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac.Infrastructure.Reporting\Services\Impl\PaccarReportService.cs:75
   EZTrac.Controllers.ReportController.GenerateReport(IReport report) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac\Controllers\ReportController.cs:181
   EZTrac.Controllers.ReportController.GetReportFileStreamResult(ReportInputBase reportInput) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac\Controllers\ReportController.cs:174
   EZTrac.Controllers.ReportController.DealerTransactionReportDownload(DealerTransactionForm form) in d:\TeamBuild\WorkingDirectory\Nightly Build\EZTrac\Controllers\ReportController.cs:78
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +85
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
   System.Web.Mvc.Controller.ExecuteCore() +123
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3053 

EDIT

it looks like when the report is very large (not sure what the threshold is) then the PDF fails to render. (40+ PDF pages makes it error but not 5 or less for example).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

源来凯始玺欢你 2024-08-21 02:54:40

尝试查看呈现报告的服务器上的错误日志可能是个好主意。查看 RS 是否发生了特定的情况。您可以从 Visual Studio 本地将报告生成为 PDF 格式吗?

我以前见过类似的行为,如果它真的超时了。这份报告需要一些时间来制作吗?导出为其他格式怎么样?

It may be a good idea to try and look at the error logs on the server that renders the report. Look to see if there is something specific occurring with RS. Can you produce the report locally from Visual Studio into a PDF?

I've seen similar behavior before if it is actually timing out. Should this report take a bit of time to produce? What about exporting to other formats?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文