Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET PRINTER TO NAME and REPORT FORM TO PRINTER
Message
From
29/10/1997 08:53:10
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00057169
Message ID:
00057179
Views:
30
>I've a problem when I change the printer where I want to output the report, the report is always printed on the default printer.
>
>I've tried with this code :
>
>SET PRINTER TO NAME GETPRINTER()
>REPORT FORM myReport TO PRINTER
>
>My printers are on a Novel network or are device like Fax Driver
>
>It's a VFP 5.0 bug or I'm doing an error ?
>
>Thanks in advance,

I had this problem too. The .frx saves the default printer information and codes. This is one of the shortcomings for foxpro (IMO). In any case, here is a solution. This solution only works if the same printer drivers and codes are used. Generally, all HPLJ's are the same, so it should work in *most* offices.
USE myreport.frx
REPL expr WITH '', tag WITH '', tag2 WITH ''
<i> if the report is landscape, also do this:</i>
REPL expr WITH 'ORIENTATION = 1'
This removes the printer codes from the report and so output will be directed to the printer specified by SET PRINTER TO NAME MyDefaultPrinter.

The other, simpler alternative is to use REPO FORM myReport TO PRIN PROM NOCO. This will allow VFP to override the printer codes specified by the report.

I'll bet that there are other, more elegant solutions, but these are the easiest to implement.
Matt McDonnell
...building a better mousetrap with moldy cheese...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform