Link to home
Start Free TrialLog in
Avatar of HCPCJJ1
HCPCJJ1Flag for United States of America

asked on

Is there a way to print a FoxPro report to PDF and name the file programatically?

I have VFP 9 and Adobe Acrobat XL Standard Edition.  I have a group of FoxPro reports that I need to print to PDF on a daily basis.  Each report will have a unique file name.
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

You may use FoxyPreviewer: http://foxypreviewer.codeplex.com/ 
It allows to produce several output formats incl. PDF with defined name. You just have to add about 3 lines of code to your program.

Also PDFCreator is free but not so simple to use: http://www.pdfforge.org/pdfcreator
ASKER CERTIFIED SOLUTION
Avatar of jrbbldr
jrbbldr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HCPCJJ1

ASKER

Thanks for the reply.  I have used your solution in other VFP applications.  The only problem with this method is that it changes the Adobe settings for all other programs as well.  This will tend to confuse my users.  I have not tried BullZip - I'll give it a try and maybe won't have to mess with the users Adobe settings.
Avatar of GEOFS
GEOFS

I have also had success using a pseudo printer called Generic Color PS for Commercial Printing, which is available from Microsoft's website, and software called GhostScript, which is available at ghostscript.com.
We specifically selected the Generic Color PS printer and GhostScript combination in order to avoid having to purchase and install Acrobat.
The only problem with this method is that it changes the Adobe settings for all other programs as well.

BullZip is not the only PDF 'Printer' out there, but I have used it often and like it for a number of reasons.

BullZip has nothing to do with Adobe and will therefore will not change any of these settings.
However, Do Not make BullZip your workstation's Default Printer.
Instead have your VFP application use it temporarily and then revert to the workstation's 'standard' default printer.

Good Luck
I have used your solution in other VFP applications.  The only problem with this method is that it changes the Adobe settings for all other programs as well.
To which solution are you referring?
The solutions given may change the printer, but not acrobat settings, as far as I see.
As you use a more advanced version of Acrobat than just the free reader, there should be ways to make use of it.
It should be Acrobat XI (xi) Standard Edition, there is no XL version,

First, you get a printer named "Adobe PDF" installed, and can simply
SET PRINTER TO NAME "Adobe PDF"

Open in new window

before printing.

As far as I see a demo video this will prompt the user to specify a folder and filename to save to. As far as I see Adobe only will provide developers a chance to avoid that prompt, if you buy one of their much more expensive server products. But why not ask them, how you can do that with your version?

Bye, Olaf.
As far as I see a demo video this will prompt the user to specify a folder and filename to save to

This is why I prefer using BullZip.

It CAN do that but it CAN ALSO be pre-configured to ALWAYS write to the same Directory and Filename (which is the way that I use it).

By having BullZip always write every PDF to the same directory and filename, my VFP application can always 'know' where it is and what its name will be.

Then, after writing the PDF file, the VFP application can, all on its own (no user intervention required), rename the file and put it where it really needs to go.

Good Luck
Avatar of HCPCJJ1

ASKER

Worked perfectly.  Thank you.