Page 1 of 1

Out of memory exception when saving large document

Posted: Wed Dec 18, 2019 9:11 am
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.

Re: Out of memory exception when saving large document

Posted: Tue Dec 24, 2019 11:30 am
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.