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

2025-10-21

FoxyPreviewer3 and VFPA64


FoxyPreviewer has long been a trusted tool in the Visual FoxPro community, offering enhanced reporting capabilities, PDF exporting, previewing, and much more. While full compatibility with VFPA32 and VFPA64 hasn't been a core development goal, many developers have asked how well FoxyPreviewer works in these environments.

I'm happy to share that:


🧩 FoxyPreviewer3 now works well with VFPA64!


There were a few reported issues in the past—ranging from minor glitches to isolated crashes—but these now appear to be resolved. In recent tests and community feedback, FoxyPreviewer has been performing normally under VFPA64, with no significant problems.

⚠️ If you do encounter any issues specific to VFPA, please report them directly to: vfpimaging @ hotmail.com

 


🔍 A Quick Refresher: What FoxyPreviewer Brings

💾 PDF, RTF, XLS, Image Exporting
Easily export reports to multiple formats, including native PDFs, without requiring additional software.

🖨️ Advanced Report Previewer
Modern and flexible preview window with toolbar, zoom, search, annotation, and print features.

🎨 Custom Report Output
Supports dynamic fonts, images, barcodes, and more using ReportListener hooks.

📌 Localization and Configuration
Fully customizable toolbars, multi-language support, and user-friendly settings programmatically or interactively.


🤝 A Word of Thanks

A special thank-you goes to Chen, the developer of VFPA (Visual FoxPro Advanced), for his responsiveness and collaboration in addressing compatibility issues.


🔗 Useful Links

Thanks to the community for the feedback and testing—keep it coming!




⚠️ Important note about VFPA compatibility

FoxyPreviewer is an independent project and has no direct relation to VFPA or its development.
I’m not responsible for VFPA32 or VFPA64, and users should use these versions at their own risk.

FoxyPreviewer is not officially supported in the VFPA environment, and I don’t explicitly test each new release there.
If you decide to use it with VFPA, please make sure to perform your own compatibility testing.


2025-10-09

Sending Emails with FoxyPreviewer3 Using Gmail SMTP

If you're using Gmail to send emails through FoxyPreviewer3, there's one crucial step you need to take before anything else: create an App Password.

🔐 Why You Need an App Password

Gmail has tightened its security by requiring App Passwords for third-party apps like FoxyPreviewer3. Your regular Gmail password won’t work—even if you enter it correctly. App Passwords are 16-character codes that allow secure access without compromising your main credentials.

You can generate one by visiting Google App Password Settings. Make sure 2-Step Verification is enabled on your account first.

🌐 Choosing the Right SMTP Port

Gmail supports two SMTP ports for sending emails: 

 Port  Encryption  Use Case
 465  SSL     Traditional secure SMTP
 587  TLS / SSL  Modern secure SMTP

 

 Both work with FoxyPreviewer3—you just need to configure the settings correctly.

🧪 Sample Configurations for FoxyPreviewer3

✅ Using TLS on Port 587

* Send E-mail using smtp.gmail.com using TLS

* Requirements:
*   .nEmailMode  = 7 && Powerscript Mail
*   .cSMTPServer = "smtp.gmail.com"
*   .lSMTPUseSSL = .T.
*   .lSmtpUseTLS = .T.
*   .nSmtpPort   = 587

✅ Using SSL on Port 465

* Send E-mail using smtp.gmail.com using SSL

* Requirements:

*   .nEmailMode  = 2 && CDOSYS Mail
*   .cSMTPServer = "smtp.gmail.com"
*   .lSMTPUseSSL = .T.
*   .lSmtpUseTLS = .F.
*   .nSmtpPort   = 465

🧩 Full FoxyPreviewer3 Email Script

Here’s a complete example that sends a report as a PDF via Gmail:


DO FoxyPreviewer && https://www.foxypreviewer.com/

WITH _Screen.oFoxyPreviewer

    * All e-mail settings that will work for sending under preview or programmatically


    * 1 - Your CDOSYS SMTP settings here:
    .nEmailMode    = 2 && CDOSYS Mail
    .cSMTPServer   = "smtp.gmail.com"
    .lSMTPUseTLS   = .F.
    .nSMTPPort     = 465
    .lSMTPUseSSL   = .T.


    * 2 - Your POWERSCRIPT-Mail SMTP settings here:
    .nEmailMode    = 7 && Powerscript Mail
    .cSMTPServer   = "smtp.gmail.com"
    .lSMTPUseTLS   = .T.
    .nSMTPPort     = 567
    .lSMTPUseSSL   = .T.


    .cSMTPUserName = "youraccount@gmail.com"
    .cSMTPPassword = "abcd efgh ijkl mnop" && Your App Password provided by Google

    .cEmailFrom    = .cSmtpUserName
    .cEmailTo      = "vfpimaging@hotmail.com"
    .cEmailSubject = "Test FoxyPreviewer Email using GMAIL SMTP server"
    .cEmailBody    = "Test Email"

    * Create a PDF from a Report
    LOCAL lcDestFile
    m.lcDestFile = SET("Default") + CURDIR() + SYS(2015) + ".pdf"
    REPORT FORM _SAMPLES + "Solution\Reports\Colors.frx" TO FILE (m.lcDestFile)

    * Send the just created file programmatically
    .SendReportToEmail(m.lcDestFile)

ENDWITH


🔐 Security Reminder


To keep your Gmail account safe while using FoxyPreviewer3:

  • Never share your App Password publicly—even in screenshots or sample code.
  • Avoid hardcoding passwords in scripts. Instead, consider storing them securely using encrypted configuration files or environment variables.
  • Use a unique App Password for each application or device. This limits exposure if one gets compromised.
  • Monitor your Google Account activity regularly to spot any suspicious logins or unauthorized access.
  • Revoke unused App Passwords from your Google Account Settings to reduce risk.