Free Support Forum - aspose.com

ReportRenderingException MemoryStream length must be non-negative and less than 2^31

We have SSRS reports that contain several charts. These reports are rendered through a custom .NET MVC app to PDF, or to PowerPoint using Aspose slides.

We recently moved the reports from a 2005 SSRS server to a 2008 R2 SSRS server. The reports mostly work well. One report, however, is throwing the following error whenever the number of pages is large (19) and we try to render to PowerPoint (PDF works okay).

The same report renders fine to PowerPoint if different filters are applied that result in fewer pages.

Any ideas? I'm not sure if this is a SSRS issue or Aspose or .NET. Thanks in advance.

Error Message: Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.ArgumentOutOfRangeException: MemoryStream length must be non-negative and less than 2^31 - 1 - origin. Parameter name: offset

Hi Joe,


Thanks for inquiring Aspose.Slides.

I have observed the issue shared by you. Have you tried exporting the problematic report to PDF or Tiff. If the report renders fine to PDF or Tiff and failed on exporting to presentation using Aspose.Slides then please share the source RDl file with us by using Adventure Works as data source. Please also share the RPL file for your report as well by following the guide lines shared here. Please also share the generated PDF and Tiff file for reference. I am assuming that you have used our latest available version of Aspose.Slides for Reporting Services 4.6.0 on your end.

Many Thanks,

Hi Mudassir,

Thanks for the prompt reply to my issue. I created a sample report based on the AdventureWorks database that demonstrates this issue. Then I found the root cause. The issue occurs whenever there are extra blank pages in the report. In my case, there are several subreports that were causing unwanted blank pages to appear. After correcting this, I no longer get the MemoryStream error I posted.

Thank you,
Joe

Hi Joe,


That is really appreciable that you have been able to figure out the issue on your end. Please share with us if there is any further issue on your end related to Aspose.Slides. I will be obliged to help you further.

Many Thanks,