Hi,
I have some code set to do some automatic printing for a report. The user selects the printer they want first using a dialog box. The dialog box is populated with a list of printers. Since the report is goig to be printed to 2 different printers depending on a value in the data.
This code is used to get values, etc then used to populate the dialog box
dim cprinter as c
dim cprinterset as c
dim ptr as P
dim ptr.dummy as L
ptr.dummy = .t.
cprinter = ui_printer_default_get()
cprinterset = ui_printer_settings_get(cprinter, ptr)
2 values are set in the dialog cprinter and yprinter.
When the printing is done then this command is issued in the script just ahead of the print command which is this:
report.print("Invoice_Logo","Accounts->Invoiceno = " + "'" + word(foo.value,-1) + "'","")
last_printer = :report.printer_override(cprinter) or
last_printer = :report.printer_override(yprinter)
It runs quite well, sending the reports to the proper printers, etc all automatically.
My problem is that when it is all done, I need to be able to set the printing back to a normal process. If I go to print a different report or letter, I don't get the normal windows pop up to select a printer. The report goes automatically to the whatever the last printer was assigned in the routine list above. So obviously we need to reset the Alpha Printing so that we can get the normal windows popup. The only way to get it back is to resstart Alpha. The help file has nothing on how to reset the printing to the defaults.
the help file say that using the command :report.printer_override(cprinter,oriprinter) the oriprinter is supposed to hold the original settings. But that doesn't work.
Anyone have any ideas?
Thanks,
mike
I have some code set to do some automatic printing for a report. The user selects the printer they want first using a dialog box. The dialog box is populated with a list of printers. Since the report is goig to be printed to 2 different printers depending on a value in the data.
This code is used to get values, etc then used to populate the dialog box
dim cprinter as c
dim cprinterset as c
dim ptr as P
dim ptr.dummy as L
ptr.dummy = .t.
cprinter = ui_printer_default_get()
cprinterset = ui_printer_settings_get(cprinter, ptr)
2 values are set in the dialog cprinter and yprinter.
When the printing is done then this command is issued in the script just ahead of the print command which is this:
report.print("Invoice_Logo","Accounts->Invoiceno = " + "'" + word(foo.value,-1) + "'","")
last_printer = :report.printer_override(cprinter) or
last_printer = :report.printer_override(yprinter)
It runs quite well, sending the reports to the proper printers, etc all automatically.
My problem is that when it is all done, I need to be able to set the printing back to a normal process. If I go to print a different report or letter, I don't get the normal windows pop up to select a printer. The report goes automatically to the whatever the last printer was assigned in the routine list above. So obviously we need to reset the Alpha Printing so that we can get the normal windows popup. The only way to get it back is to resstart Alpha. The help file has nothing on how to reset the printing to the defaults.
the help file say that using the command :report.printer_override(cprinter,oriprinter) the oriprinter is supposed to hold the original settings. But that doesn't work.
Anyone have any ideas?
Thanks,
mike
Comment