logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Forgot password?
    • en
    • ru
    • pt
    • es
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to create one single report out of several in Delphi / Lazarus / C++ Builder
  • How to create a file in Excel 97 (2000, XP) – XLS from Delphi / C++Builder / Lazarus?

    May 18, 2020

    Oh, it’s an eternal topic – creating an Excel spreadsheet from Delphi. Excel spreadsheets are

    read more
  • Saving SVG images from Delphi / C++ Builder / Lazarus

    August 13, 2020

    The SVG file is a two-dimensional vector image based on documents in XML format. The

    read more
  • Creating an Open Document Text (ODT) file from Delphi / C++Builder / Lazarus

    August 6, 2020

    The ODT file extension is used for Open Document text files, which are usually created

    read more
  • How to export a report to Excel XML from Delphi / Lazarus

    May 25, 2020

    A developer has a huge choice of options when the task is to export to

    read more
  • How to work with SHP maps in Delphi / Lazarus / С++ Builder

    September 28, 2020

    ShapeFile, also known as Shape is a figure or a set of complex shape figures

    read more

How to create one single report out of several in Delphi / Lazarus / C++ Builder

December 11, 2020

I would like to note that FastReport VCL is one of the most convenient components for generating reports of any complexity. After all, here we can use not only different types of DBMS, but also Swiss barcodes, maps, tables, graphs and many other objects. Quite often we are asked “how to create one single report out of several?”. Well, easy! Look!

For this purpose, FastReport has a function that helps to create a new report in addition to the previously generated one. The TfrxReport.PrepareReport method has one optional ClearLastReport:Boolean parameter, which by default is True. This parameter determines whether the pages of the previously built report should be cleared. There is one small detail. When creating the first report, you use a DataSet from one database, when creating the second report – from another.

An example of building a combined report:

Pascal:
frxReport1.LoadFromFile('1.fr3');
frxReport1.PrepareReport;
frxReport1.LoadFromFile('2.fr3');
frxReport1.PrepareReport(False);
frxReport1.ShowPreparedReport;

 

C++:
frxReport1->LoadFromFile("1.fr3");
frxReport1->PrepareReport(true);
frxReport1->LoadFromFile("2.fr3");
frxReport1->PrepareReport(false);
frxReport1->ShowPreparedReport();

Load the first report and build it without showing it on the screen. Then load the second one into the same TfrxReport object and build it with the ClearLastReport = False parameter. This adds the report to the previously generated one.

The second-to-last two lines can be repeated to add more and more reports. This option is only available from code.

After you have finished working with the databases, you can see the resulting file in the preview window. You can also immediately save it to any destination in any desired format – PDF, SVG, Text file, etc. without any difficulties.

about product download buy
avatar
Michael Philippenko
CEO
VCL Lazarus FastReport 6 Delphi

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Our team
  • Contact us

© 1998-2021 by Fast Reports Inc.

  • Privacy Policy