Export Rendered Report to the PDF File
Our sample projects and report templates can help you learn the basics of working with our products.This example is outdated, you can check out the many other new examples in this category.This sample project demonstrates how to render and export some different reports to one PDF file. For example using three different reports -
Then, create a new summary report:
Add rendered pages from
In the end, export the report and save result to the file:
SimpleList.mrt, SimpleGroup.mrt and Master-Detail.mrt. Create new report objects and assign these report templates:
private void button7_Click(object sender, System.EventArgs e)
{
StiReport report1 = GetReport("SimpleList.mrt");
StiReport report2 = GetReport("SimpleGroup.mrt");
StiReport report3 = GetReport("Master-Detail.mrt");
...
Then, create a new summary report:
...
StiReport report = new StiReport();
report.Render(false);
report.RenderedPages.Clear();
...
Add rendered pages from
SimpleList.mrt, SimpleGroup.mrt and Master-Detail.mrt templates to this report:
...
foreach (StiPage page in report1.RenderedPages)
{
report.RenderedPages.Add(page);
}
foreach (StiPage page in report2.RenderedPages)
{
report.RenderedPages.Add(page);
}
foreach (StiPage page in report3.RenderedPages)
{
report.RenderedPages.Add(page);
}
...
In the end, export the report and save result to the file:
...
report.ExportDocument(StiExportFormat.Pdf, "d:\\file.pdf");
}