Hello, (Version 7.9)
I’m having trouble printing reports to 3 different networked printers. I have a project that I intend to use to generate 3 reports and print them to three different networked printers.
So, my specific question is this… What format do my printer names need to be in? Full networked path? Name as it appears on the client PC?
I’ve read several forum posts on printing to specific printers and have discerned that the format might need to be whatever the gateway has, if that is true for this function, how do I find out what the gateway has for a specific printer name.
I have a script on a print button;
event.source.parent.getComponent('Report Viewer_Main').print(r"\\ngvlabel-a\Zebra 220Xi4 (300 dpi) 16278-01", 0)
event.source.parent.getComponent('Report Viewer_Duplicate').print(r"\\ngvlabel-a\Zebra 110Xi (300 dpi) 16278-04", 0)
event.source.parent.getComponent('Report Viewer_CNG Warning').print("Zebra 220Xi4 (300 dpi)", 0)
to select and print my report viewers/obects, but I get errors saying that it can’t find the printers for the first two. The third is the default printer (the reason I don’t have the full network path called out), which, just by chance is the correct printer for that particular report (label).
When I use
event.source.parent.getComponent('Report Viewer_Main').print()
event.source.parent.getComponent('Report Viewer_Duplicate').print()
event.source.parent.getComponent('Report Viewer_CNG Warning').print()
(With no specific printer name selected) I’m able to print each report individually via the print prompt that comes up for each report and select each printer from the printer name drop down.
I’ve tried something like this;
job = system.print.createPrintJob(event.source.parent.getComponent('Report Viewer_Main'))
job.setShowPrintDialog(0)
job.setPrinterName("Zebra 220Xi4 (300 dpi)")
job.print()
But it still cannot find the printer unless it happens to be the default printer. Also with this method I would need to do a lot more format tweaking that I’d rather not do, since the second script works beautifully for simply printing. It just doesn’t print to a specific printer automatically.
Any help would be great!