Home » Uncategorized » VFP 9 Hidden Gem: Chaining Reports

I can now admit I have not used the report chaining capability Microsoft added to Visual FoxPro in VFP 8, at least until two days ago. It is the typical case of finally hitting the need for the feature.

One of my clients called me into a project where they are struggling to make a report break to a new page based on the data. I played around with the report for an hour and was able to break to a new page where they wanted it to break, but the side-effects were forcing a page break later that was not desired. I tried a couple more things by adding extra groupings, but it was not working as desired.

Since the developer was using VFP 8, I thought of chaining reports. I split the one report into two reports and called them with the appropriate commands:


The NOPAGEEJECT clause tells VFP to not close the print job. This worked like a charm when printing to the printer. I then moved to the preview logic and whammy, I was getting two previews for each of the records. Crud! When I tested running the reports to Acrobat I was getting prompted for two file names. Double crud! Another great idea crashing and burning. Even though this report is not previewed as often as it is printed, I suspected the users were not going to be happy with this, especially since they like to print the reports to Acrobat.

So I fire up VFP 9 and run the exact same code. I was not expecting different results, but I wanted to see how the reports looked in the new Report Preview window. I was going to investigate how the new ReportListener might help. To my surprise, the preview window was only opened once per record. The VFP 9 report chaining is way smarter! A hidden gem (at least to me).

As a bonus, the graphic images not printing to the Acrobat 6 PDF driver in VFP 8 are printing just fine from the VFP 9 reports. Double bonus. So once again, Richard Stanton (Fox Team Report Designer guy extraordinaire): you da man!

So if you are struggling with reports in any version of VFP prior to 9, head out and upgrade and see if your struggles are reduced or even eliminated. This simple little behavior change just sold two copies of VFP 9 to the two developers I am working with on this project.

Add reply