Saving report by pages into hard drive
Posted: Mon Jun 10, 2024 12:01 pm
Hello every one.
I have the problem with using a lot of memory for creating StiReport. My app creates a report by pages, and saves the main report into hard drive in the end. The main report becomes large in the process.
Step 1: I'm creating a main report:
Step 2: Then I'm rendering another report, and adding pages into the main report:
Step 3: Then I'm saving the main report into hard drive:
How to save report pages into hard drive after adding pages into "RenderedPages" pages? maybe i have mistake and must use another solution?
I have the problem with using a lot of memory for creating StiReport. My app creates a report by pages, and saves the main report into hard drive in the end. The main report becomes large in the process.
Step 1: I'm creating a main report:
Code: Select all
var mainReport = new StiReport()
{
IsRendered = true,
NeedsCompiling = false,
ReportName = "Some name"
};
Code: Select all
var report = new StiReport();
// this some code
await report.RenderAsync();
foreach (StiPage page in report.RenderedPages)
{
page.Report = mainReport;
page.Guid = Guid.NewGuid().ToString("N");
mainReport.RenderedPages.Add(page);
}
// here the main report becomes large
Code: Select all
var data = mainReport.SavePackedDocumentToByteArray();
// this saving into hard drive by stream