Scenario: i have 2.500 .mdz files of 168 KB each one (they contains images in them, "StoreImagesInResources=True") and i need to merge them in a single report, adding a blank page after each one
But about at 1/3 of the work,
i receive the error "Insufficent memory".
This is the code i use to merge these 2.500 reports in one:
Code: Select all
Dim CumulativeReport as Stimulsoft.Report.StiReport
for cicl as integer=1 to 2500
Dim SingleReport as Stimulsoft.Report.StiReport=GetMySingleReport(cicl)
if cicl=1 then
'First time, assigns the cumulative report
CumulativeReport = SingleReport
else
'Adds pages from single report to cumulative report
For Each page As Stimulsoft.Report.Components.StiPage In SingleReport.RenderedPages
CumulativeReport.RenderedPages.Add(page)
page.Report = CumulativeReport
Next
endif
'Adds a blank page
Dim p As New Stimulsoft.Report.Components.StiPage
p.PageWidth = CumulativeReport.RenderedPages(0).PageWidth
p.PageHeight = CumulativeReport.RenderedPages(0).PageHeight
CumulativeReport.RenderedPages.Add(p)
if cicl>1 then
'Does not dispose the first report
'because it is the "base report".
SingleReport.Dispose
SingleReport=Nothing
endif
next cicl
Am i going off limits? Is there something i can do to solve this?
Thank you.
-- edit:
I have noticed that the error often raises when i load in memory the .mdz file to create the "SingleReport" (this happens in "GetMySingleReport" function).
During processing, the memory occupation goes very high.