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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send a Report Generated in FoxPro 2.5 via email 1

Status
Not open for further replies.

JmichaelSR

Programmer
Mar 17, 2004
15
US
I have a FoxPro 2.5 program that generates a report which I would like to send as an attachment on an email. I have found that by replacing the "TO PRINTER PROMPT" in the following code with "TO FILE c:\trans.txt" a file is generated rather than a printer report.


DO CASE
CASE pb_print = 1 &&Print
SAVE SCREEN
REPORT FORM (report_name) ;
TO PRINTER PROMPT (CHANGDED THIS LINE)
RESTORE SCREEN
CLEAR READ

CASE pb_print = 2 &&Preview

The problem is that the file created is in a format that would be meaningless to the person receiving the email. I want a file that would contain information that would appear just as it would on a printed report. Any ideas on how I could do this?

Any help or suggestions would be appreciated.

Thanks,

Mike
 
Have you considered printing your Report to a PDF file using a Windows PDF Print driver?

That PDF file would 'mirror' your Report Form layout.

Obviously the following is dependent on the OS that your workstation is running.

There are a lot of PDF Print drivers for Windows on the web and a number of them are free.

The ones I look for can be pre-configured to output the PDF document to a fixed location with a fixed filename. I can then, after 'printing' the report, have the application use the COPY FILE command to move the PDF file (if necessary) and rename it (again, if necessary) along the way.

You just need to have your application temporarily change the printer to the PDF printer, issue your REPORT FORM command and then change the printer back.

After that you can use the PDF file as needed.

Good Luck,
JRB-Bldr
 
jrbbldr,

Thanks for your help. I will look into what you suggest.

Mike
 
jrbbldr,

Thank you so much for pointing me in the right direction. I did what you suggested and things turned out GREAT!



Mike Clark
Programmer/Analyst
Mississippi State Fire Academy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top