I’m working on a project that has a few old reports (pallet labels) created prior to the reporting module update in 7.8. These reports print fine on an inkjet printer when you manually right click on the report and choose ‘print’.
Our goal is to remove this manual step, and automatically print these reports on a Zebra ZD620 thermal sticker printer. The reports and the stickers are both 4x6 inches.
I have two separate problems preventing me from accomplishing this.
I know this is a fairly common use case, but I’m having difficulty properly configuring the print job. I’m attempting to use the following code that’s suggested in other similar posts:
report = event.source.parent.getComponent(“Report Viewer”)
…#set various options
This prints, but at the component level so there are page numbers and the scaling % dropdown visible on the label. If I manually print via the right click context menu, everything is perfect. Is there any way to create the print job programmatically that behaves similar to the context menu printing? Or is it only possible to print the component via scripting?
When I attempt to print the label to the Zebra, the orientation is initially wrong. Even setting report.orientation doesn’t change this. However, if I print to the inkjet first, then the Zebra after, everything prints correctly. This leads me to believe that certain inkjet printer settings carry over to the Zebra job. Looking at the page setup tab, it looks like the inkjet printer allows me to select a paper size, while the Zebra does not. Is there a way to determine what settings at being used on the inkjet job that might be absent from the Zebra job?
Inkjet shows paper size:
Zebra does not:
If I cannot find a solution, My plan B is to recreate the label in ZPL, but since the label actually does print correctly under certain circumstances, I’d rather not reinvent the wheel.
Thanks for your time.