2025-10-28

Creating Merged Reports and Exporting to PDF using FoxyPreviewer (Chaining / Combining reports)

One of the coolest possibilities brought to VFP9 reports is the ability to merge more than one report in a single run.
This is done by using the clauses NOPAGEEJECT and NORESET:
  • NOPAGEEJECT tells the Report Engine to wait for the next report instead of ejecting the current page.

  • NORESET keeps the page counter continuing from the previous report session.

This simple but powerful combination lets you join several reports into a continuous output — ideal for creating consolidated reports, multi-section documents, or any case where different layouts should appear in a single file.

And the best part: FoxyPreviewer works beautifully with merged reports — whether you just preview them on-screen or export them directly to PDF, Excel, or other formats.

Below are a few common scenarios and how to handle them using FoxyPreviewer.

⚠️ Important: When working with merged reports, the PREVIEW and/or TO FILE clauses must appear in all the REPORT FORM commands in your sequence.
Otherwise, the reports will not merge properly, and you might see only the first one.



🧩 1. Merged Report with Preview

You can easily merge several reports and display them in FoxyPreviewer’s interactive preview window.
Here’s the general idea:

* Sample 1
* Chained report / Normal Preview
DO FoxyPreviewer.App
REPORT FORM (_Samples + "\Solution\Reports\Colors.frx") NOPAGEEJECT PREVIEW
REPORT FORM (_Samples + "\Solution\Reports\Wrapping.frx") NOPAGEEJECT NORESET PREVIEW
REPORT FORM (_Samples + "\Solution\Reports\Percent.frx") NORESET PREVIEW

The reports will appear seamlessly one after another, sharing the same preview session.


🧩 2. Merged Report → Save to PDF and Open in Default PDF Viewer

If you want to create a merged report and automatically save it as a PDF, then open it in the user’s default PDF reader, FoxyPreviewer makes that just as easy:

* Sample 2
* Chained report / Save to file / Preview in default PDF reader
DO FoxyPreviewer.App
lcFile = "c:\Temp\MyReport.pdf"
REPORT FORM (_Samples + "\Solution\Reports\Colors.frx") NOPAGEEJECT TO FILE (lcFile) PREVIEW
REPORT FORM (_Samples + "\Solution\Reports\Wrapping.frx") NOPAGEEJECT NORESET TO FILE (lcFile) PREVIEW
REPORT FORM (_Samples + "\Solution\Reports\Percent.frx") NORESET TO FILE (lcFile) PREVIEW

This approach is great for automated workflows or batch processing — the user gets the final PDF file immediately.


🧩 3. Merged Report → Save to PDF without Preview (Silent)

Sometimes you just need to generate the final PDF file silently — for example, when the output is sent by email or stored in a shared folder.

* Sample 2
* Chained report / Save to file / NO Preview (silent)
DO FoxyPreviewer.App
lcFile = "c:\Temp\MyReport.pdf"
REPORT FORM (_Samples + "\Solution\Reports\Colors.frx") NOPAGEEJECT TO FILE (lcFile)
REPORT FORM (_Samples + "\Solution\Reports\Wrapping.frx") NOPAGEEJECT NORESET TO FILE (lcFile)
REPORT FORM (_Samples + "\Solution\Reports\Percent.frx") NORESET TO FILE (lcFile)

No window is shown; the file is generated in the background, ready to use.


✅ Wrapping Up

Merging reports is one of those features that makes VFP9’s reporting engine truly shine — and with FoxyPreviewer, the possibilities go even further.
You can mix multiple report layouts, include summaries, attach additional pages, and export everything in one clean, professional-looking PDF.

If you haven’t tried it yet, download the latest version from
👉 www.foxypreviewer.com

No comments:

Post a Comment