Export many reports to one PDF File

edited 6:01PM in FastReport .NET
Hello,
in my application a test report is created for each test object. The user can select the reports he want to see and print it out.
I have a function which iterates through all selected rows and print out the report.
Now I want to create a function to export all selected reports into one PDF file. To export the report to an pdf file I can simply call
export = new FastReport.Export.Pdf.PDFExport();
report1.Export(export, "result.pdf");
but this will create one file for each report. When I had a look at the report1.Prepare(true); parameter it says the boolean parameter is either for appending the report to the one before or create a new one. But this won't work for me. How can I export multiple reports in one single PDF file ?

Comments

  • edited 6:01PM
    Composing several reports into one is the task of the reporting engine, not of the export module. Before calling the Export routine, you should setup the Report object so as it will combine all reports into one.
  • edited 6:01PM
    Ok, and how ? Do you have an example ?
    Just to make clear it is always the same report which is called with different data e.g 10 times. After this procedure I want to have one PDF file containing the data of all 10 reports.
  • edited May 2011
    The code should look like this:
    Report.LoadFromFile('Report1.fr3');
    Report.PrepareReport();
    Report.LoadFromFile('Report2.fr3');
    Report.PrepareReport(False);
    Report.LoadFromFile('Report3.fr3');
    Report.PrepareReport(False);
    Report.Export(....);
    

    or like this:
    Report1.LoadFromFile('Report1.fr3');
    Report1.PrepareReport();
    Report2.LoadFromFile('Report2.fr3');
    Report2.PrepareReport();
    Report1.PreviewPages.AddFrom(Report2);
    Report1.Export(....);
    
  • edited 6:01PM
    Thanks,
    this works for me. I had to change the parameter in prepare from fals to true, because im always using the same report

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.