Out of memory exception when saving large document

Stimulsoft Reports.WEB discussion
Post Reply
Abed Hamodi
Posts: 19
Joined: Wed May 18, 2016 9:55 am

Out of memory exception when saving large document

Post by Abed Hamodi »

Hello ,
When trying to save a large document to get mdc file , sometime occur exception ( out of memory exception)
Please see my code and exception :

Code
StiReport report = new StiReport();
report.Load(template);
report.AutoLocalizeReportOnRun = true;
report.ReportCacheMode = StiReportCacheMode.On;
report.RenderedPages.CacheMode = true;
report.RenderedPages.CanUseCacheMode = true;
report.Render(false);
MemoryStream stream = new MemoryStream();
report.SaveDocument(stream);

_______________________________
Excetion :

Exception of type 'System.OutOfMemoryException' was thrown. Stack trace: at System.IO.MemoryStream.set_Capacity(Int32 value) at System.IO.MemoryStream.EnsureCapacity(Int32 value) at System.IO.MemoryStream.WriteByte(Byte value) at Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService.CorrectRefs(MemoryStream input, Stream output, Int64 startPosition, Int64 endPosition, Int32 baseNewRef, Int32 baseOldRef) at Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService.SaveOptimized(Stream stream, StiDocument document, StiSerializing sr) at Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService.Save(StiReport report, Stream stream) at Stimulsoft.Report.StiReport.SaveDocument(StiDocumentSLService service, Stream stream) at Stimulsoft.Report.StiReport.SaveDocument(Stream stream) at WebFreight.Web.Helpers.ReportHelper.SetStiViewer(ReportFliter reportFliter, StiBusinessObject currentBusinessObject, Byte[] template, Byte[] logo)

Thanks.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Out of memory exception when saving large document

Post by Lech Kulikowski »

Hello,

Please send us your request with detailed description on support@stimulsoft.com. We will check it and will reply to you by email fast as possible.

Thank you.
Post Reply