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

Is there a more sophisticated GETPRINTER() ?

Status
Not open for further replies.

andrewlee

Programmer
May 28, 2000
31
NZ
Hi
Is there a way to get a better Getprinter() interface ?
In the beginning of a batch reporting function, I need to allow the users to change printers and printer tray etc once only for a whole report run of different reports. When finished I can set SET PRINTER TO DEFAULT to get it back to normal. What I want is the dialog interface that the PROMPT clause produces, but get those settings to apply for multiple subsequent reports. Issuing a SYS(1037) after a SET PRINTER TO NAME GETPRINTER() is not appropriate as many clients just want to change printers, not trays.
Cheers
Andy from New Zealand
 

Hi Andy,

I don't think there's a way of displaying the report version of the dialogue, other than via REPORT FORM, in which case it will apply to the current report only.

You can easily achieve what you want by displaying two different dialogues. Before you do the first report, issue GETPRINTER(), then SET PRINTER TO NAME using the returned value from GETPRINTER(). That will establish the printer, until you tell it otherwise.

Next, use SYS(1037) to prompt for the paper source, etc. Again, do that before printing the first report. You don't need any additional code at that point. The user's choices will stay in force for all the reports.

Although that will do what you want, it is clunky solution, and not particularly user-friendly.

The other possibility is to use the PageSetupDlg() API function. You will have to set up a structure to hold the printer information, including passing the handle of your parent window. It's not particularly easy, but it's documemted at MSDN (search for PageSetupDlg).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike.I followed up with your suggestion of PageSetupDlg and found such a structure. It returns a cursor with the info I need.
Many thanks.
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top