Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a PDF file to email using a report created in VFP7.0

Status
Not open for further replies.

PatMcLaughlin

Programmer
Dec 10, 2010
97
0
0
US
I have a program that creates and prints a report from data in a text file. They now want to have the option to send this same report as an email attachment to a third recipient. I have not found anything to describe this export to pdf. Will I need to recreate this report using Crystal Reports and mail it that way or can I utilize the existing report (which is very complicated)?
 
The best and easiest way to have your VFP Report 'printed' to a PDF file is to use a PDF 'Printer'.

There are a number of FREE PDF 'Printer'/Print Drivers available on the web.

I use BullZip most often since it allows me, with appropriate pre-configuration, to eliminate the interactive user interface where the "Printer" asks where to put the file. If desired I can come back here with more explanation.

Regardless of which PDF 'Printer' you decide to use, the process in general involves 'telling' VFP to use that 'printer' instead of any other one.

Good Luck,
JRB-Bldr
 
Pat,

You certainly don't need to use Crystals Reports, and you won't even have to change the actual report in any way.

The easiest option (and probably the cheapest) is to do what JRB-Bldr suggested, and have the users install a PDF printer driver. You then only need to SET PRINTER TO NAME <PDF driver> in your application.

However, be sure to choose a driver that doesn't require any user intervention at print time. You need to be able to set the PDF filename and location programatically. This might involve programatically editing an INI file or something similar. Check the driver's documentation for details.

Another option would be to purchase a copy of XFRX, from Eqeus. With this option, you won't need to get the user to install a driver or any other special software. You will be able to generate a PDF from an existing report with just a couple of lines of code, and you will have full control over the filename and directory.

Although XFRX is not free, the cost is a one-off; there's no per-user cost.

Hope this helps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
XFRX, from Eqeus - I bought it and found it very well documented, supported, and full of more features than I expect I'll ever use.

It's also pretty easy to implement.

I have included it in any production code yet but that's only because I just haven't had time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top