Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer settings at run-time
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00189772
Message ID:
00196187
Views:
30
Sorry to bother you guys, but I was looking for some insight in solving a problem I have right now with printing reports. I was hopeful this thread would be useful, but it was not, so I wonder if you could help me with the following.

Whenever a report is created, VFP stores info about the current windows default printer in the .FRX (Objtype 1 fields EXPR,TAG and TAG2). Since my own printer is different from the printers available at the clients site, sometimes I change the page setup in the report so the metrics will be better.

So far, so good.

The problem is that, at the clients site, a user can choose from n printers, so I set up a form that will invoke GetPrinter, then do SET PRINTER TO NAME (SelectedPrinter), and then REPORT FORM frmname TO PRINT. One would expect the report coming out from the selected printer, instead it appears at the CURRENT WINDOWS PRINTER.

Well, OK, so I stuff the keyboard buffer with the selected printer name and do REPORT FORM frmname TO PRINT PROMPT, the reasoning was that when the printer dialog appeared, the keyboard buffer would play the desired printer's name, selecting it. This works fine under W98, but not W95 since the combo box that controls the printer names has to be opened first. To open it, you need F4 or Alt+PgDn, which I can't stuff in the buffer.

Well, OK again, so I copy the report file to a temporary file, and manipulate the EXPR, TAG and TAG2 fields, changing the printer name to the desired one.

This is sort of working, but I know that the actual printing is not going to be all right ALL OF THE TIME, because of differences in parameters between printer drivers.

I figure you could use some API call to change the Windows Current Printer to another and then back to what it was, but I am not conversant with the API, nor I have access to MFC.

Is there something I can do from VFP ?

I will really appreciate any help.
Previous
Reply
Map
View

Click here to load this message in the networking platform