RS Web Service throws Exception when rendering a report as a PDF file

Hello,

We have SQL Server 2012 with SP2 and with the CU5 installed.

I have a reports with some sub-reports. This report is working well from VS and can be run successfully from the Reports Manager.

However, when I want to generate a PDF by calling the RS Web Service I have the following exception :

Note that if I generate a Excel file from the exact same report with the same parameters from the web service, it works well.

System.Web.Services.Protocols.SoapException was caught

  Actor=http://localhost//ReportServer_SQL2012/reportexecution2005.asmx?wsdl

  HResult=-2146233087

  Lang=""

  Message=System.Web.Services.Protocols.SoapException: Une erreur s'est produite lors du rendu du rapport. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: Une erreur s'est produite lors du rendu du rapport. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: Une erreur s'est produite lors du rendu du rapport. ---> System.NullReferenceException: La rfrence d'objet n'est pas dfinie une instance d'un objet.

    Microsoft.ReportingServices.Library.ReportExecution2005Impl.InternalRender(String Format, String DeviceInfo, PageCountMode pageCountMode, Stream& Result, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds)

    Microsoft.ReportingServices.Library.ReportExecution2005Impl.Render(String Format, String DeviceInfo, PageCountMode pageCountMode, Byte[]& Result, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds)

    Microsoft.ReportingServices.WebServer.ReportExecutionService.Render2(String Format, String DeviceInfo, PageCountMode PaginationMode, Byte[]& Result, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds)

  Node=http://localhost//ReportServer_SQL2012/reportexecution2005.asmx?wsdl

  Role=""

  Source=System.Web.Services

  StackTrace:

        System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

        System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

        Duo.ReportServicesRender.ReportExecutionService.Render2(String Format, String DeviceInfo, PageCountMode PaginationMode, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds) dans C:\Users\Loc\Source\Workspaces\DuoNET-2014\sprint10\Duo\Web References\ReportServicesRender\Reference.vb:ligne 636

Basically there's a nullreference exception throw by the InternalReader method.

Do You have any ideas about how to correct this or how to diagnose what is the problem ?

Regards,

April 23rd, 2015 11:53am

Hi Patrice L,

According to your description, the report can display correctly in report manager, and it also works fine when exporting to Excel. But when you export the report to PDF, the error "Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: an error occurred when the report is rendered. System.NullReferenceException: object reference is not set to an instance of an object." is thrown out.

We have tested in SSRS 2012 but cant reproduce the issue. In your scenario, would you please check if only this report comes across the issue when exporting to PDF? Also please check if the PDF extension in rsreportconfig file (C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer) like below:

<Extension Name="PDF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering"/>

If issue persists, please check the Reporting Services error log (default location: C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\LogFiles) around the time that the error message thrown out.

If you have any question, please feel free to ask.

Best regards,
Qiuyun Yu

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 10:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics