Keeping Windows Default Printer to re-instate after report (OpenInsight Specific)
At 14 NOV 2001 09:53:17AM Leon Shaffer wrote:
We are running some reports that need to be landscape and condensed on laser printers. We do not have a problem of bringing up the Printer Selection Dialog Box to have the user select which printer, but we want to 1st get the workstation default printer and restore that printer (with the settings) after the report has completed.
What happens is when the user selects the printer from the dialog box for our report, that printer now become the "default" printer for that work station.
Any help is greatly appreciated.
At 14 NOV 2001 10:28AM Colin Rule wrote:
Rather than use the Windows setups, add your own call to print Setup.
For example, this is a section of code from my program…
DEFAULT_PRINTER:
Dft_Section=windows":\00\Dft_Key=device":\00\DEVICE=str(\00\,4096)GetPrivateProfileString(DFT_SECTION,DFT_KEY,\00\,DEVICE, len(DEVICE),"cssp.ini":\00\)DEVICE=DEVICE1,\00\PRINTER="PRINTER=FIELD(DEVICE,",",1)PRINTER=FIELD(DEVICE,",",3)RETURN
Open the SYSPROG ] PRINTSETUP form, adapt it and save it within your application.
Locate the Stored Procedure that this form calls and adapt it to your own app.
You can then manage print files independantly from Windows and other applications.
Colin