Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Life is getting harder with PRINTING!!
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00708279
Message ID:
00708455
Views:
13
Hi Cyrus,

You need to abandon the old way of printing in FP DOS.

I just took on a project where they have some 200+ reports (none of which were written with the report writer and all of which were sending formatting codes directly to the printer -Eeeeeek!).

Basically, what I did was:

1) Re-Direct the output to a temp file.
set device to FILE(GETENV("TEMP")+'\prtemp.txt')
2) STRTRAN the page end marker to a CSS2 PAGEBREAK style
*-- closes the temp file
set device to screen

*-- shows print dialog
m.junk=FILETOSTR(GETENV('TEMP')+'\prtemp.txt')
m.junk=STRTRAN(m.duh,CHR(12),CHR(13)+'<DIV CLASS="PAGEBREAK"></DIV>'+CHR(13))
3) I then sucked the text file into an HTML wrapper and instanced a browser object to preview/print the report.

It worked like a charm!

Thank God! I didn't have to rewrite those reports. I would have gone literally nuts!!!


Good luck!!

If you want the details, let me know.

Hugh
Microsoft hears loudest what the VFP community says about Visual FoxPro by looking at the bottom line!

Support the product. Buy the latest version!

Hugh Winters @ WorldData 408-512-1131
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform