Re: Dynamically Change Printer in UP1.9

Steven Blank


I may misunderstand, but if I do understand correctly, I'd try defining only one printer for the purpose in the Printers dialog and evaluate an INIPut at runtime to set the one printer's Queue parameter as required, to point the one Magic Printer to the desired Windows Printer. For example, suppose your Magic printer's Name is Order Printer. Then, the following INIPut expressions should point this printer at two different Windows printers:

INIPut('[MAGIC_PRINTERS]Order Printer=*Samsung ML-2510 Series,,,60')
INIPut('[MAGIC_PRINTERS]Order Printer=*HP LaserJet Series II,,,60')

Obviously, such an expression must be evaluated BEFORE the task in which the Printer IO is defined. The IO is pointed to 'Order Printer' and does not need to change at runtime; the INIPut() affects the change under the sheets.

Steve Blank

PS: I almost always test a suggestion before posting, in order to avoid shoe-leather sandwiches. I have NOT tested this and, therefore, am most likely dead wrong.

At 12:49 PM 7/14/2017, you wrote:
I think this has come up before but I can't find it when searching the archives.

I have a UP1.9 app that I need to change the Printer dynamically on based on some specific criteria.

How can I do that without the user having to make a selection?

Currently I am defining in the Printers list two printers PrinterA and PrinterB. A points to the correct printer name and B does the same.

So, for example I want to tell my report to go to PrinterA based on the location code in an Order Header being 'A' and to go to printer 'B' when the location is 'B'.

There has to a be simple way to do this, isn't there?


Join to automatically receive all group messages.