I am using the following script to print a two page report:
report = window.getComponent('Report')
report.print()
Only the first page of the report prints unless I specifically select the pages to print in the print dialog.
How can I have both pages print automatically?
Ignition version 7.5.4.
It should print both pages. Maybe the report hasn’t completed when you run the script?
That looks like the issue. If I pause for a short while before pressing “OK” on the print dialog, both pages come out. Is there a way for the script to know that the report has completed?
I think the best way to tackle this is by using an invokeLater to give it a little bit of time to complete.
Sort of. You can look at “reportLoading” property which will be 1 when loading and 0 when it is done. The problem is you would have to do a while loop or something in your script. It is best to do what Greg said and use an invokeLater to give it some time.