As a new user to Ignition, I am still trying to wrap my head around things. I am trying to print a report with the use of a button on the screen. I found that a right click over the report will allow you to print the report, I want to duplicate that function but with a button.
Right just put the following script in the actionPerformed event of the button:report = event.source.parent.getComponent("Report Viewer")
report.print()Of course replace the “Report Viewer” with the name of your report. Note: You may also have to change the path depending on where your report is compared to the button.
Here is an example that will print the root container of the window:rc = system.gui.getParentWindow(event).getRootContainer()
job = system.print.createPrintJob(rc)
job.setMargins(0.5)
job.showPageFormat = 0
job.orientation = orientation
job.print()
[quote=“Travis.Cox”]Right just put the following script in the actionPerformed event of the button:report = event.source.parent.getComponent("Report Viewer")
report.print()Of course replace the “Report Viewer” with the name of your report. Note: You may also have to change the path depending on where your report is compared to the button.[/quote]
Are there also methods for the “Save as PDF/ HTML/PNG”? If so, how do you automate so no human intervention is needed, like to launch reports from a timer script?
Just a little note on what nmudge suggested - not all (in fact, just a small fraction) of what dir() will return is readily usable or useful, and there will be no accompanying documentation.
My requirement is to print the report by clicking the button componet, I have used report module to design the report. I am doing scripting to perform this action in actionPerformed event handlers.
Is it possible to set the printer size by standards ? For example, I set the printer properties to be width and size for A4 but when the printer dialog opens up, it automatically selects Letter instead of A4.