Printing Report With Button

I’m trying to print a report with a button on the screen, this is what I have so far.

report = event.source.parent.getComponent('Report Viewer') report.showPrintDialog=0 report.print()

When I run this code it prints a screen shot of the page. I want it to print the report not a screen shot.

I’ve also tried it this way, but get the same result.

report = event.source.parent.getComponent('Report Viewer') job = system.print.createPrintJob(report) job.showPrintDialog=0 job.print()

If I run it this way it works, but I get the Print dialog box. I would like to do this without using the print dialog box.

report = event.source.parent.getComponent('Report Viewer') report.print()

There’s an example of this in the manual:

# This would print to the default printer with no user interaction report = event.source.parent.getComponent("Report Viewer") report.print(None, 0)

support.inductiveautomation.com … viewer.htm

Awesome, this works great! Thanks.

And if I want to print in a especific printer?

Since this is an old topic you should either create a new topic or flag your question as vision or perspective.

thanks, I will do it