Export Many Files to One Big PDF

This sample project demonstrates how to export many different reports to one big PDF file and create a PDF file with a lot of report copies. For example, create one rendered report and add it 1000 times in the output PDF file. Create the new report object and enable the necessary options:

private void buttonExportClick(object sender, EventArgs e)
{
    var report = new StiReport();
    report.ReportCacheMode = StiReportCacheMode.On;
    report.RenderedPages.CanUseCacheMode = true;
    report.RenderedPages.CacheMode = true;
    report.RenderedPages.Clear();
...


Then, add the rendered report 1000 times:

...
    var tempReport = new StiReport();
    for (int index = 0; index < 1000; index++)
    {
        using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(
"ExportManyFilesToOneBigPDF.MasterDetail.mdc"))
        {
            tempReport.LoadDocument(stream);
        }
        tempReport.ReportUnit = report.ReportUnit;

        foreach (StiPage page in tempReport.RenderedPages)
        {
            page.Report = tempReport;
            page.Guid = System.Guid.NewGuid().ToString().Replace("-", "");
            report.RenderedPages.Add(page);
        }
    }
 ...


In the end, export the report:

...
    report.ExportDocument(StiExportFormat.Pdf, "d:\\1.pdf");
}


In the screenshot below you can see the result of the sample code.

Export many files to One Big PDF