# Print Two Page Report

**URL:** <https://forum.inductiveautomation.com/t/print-two-page-report/5916>\
**Category:** Ignition\
**Created:** [February 22, 2013, 7:45pm UTC](https://forum.inductiveautomation.com/t/print-two-page-report/5916 "2013-02-22T19:45:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [February 22, 2013, 7:45pm UTC](https://forum.inductiveautomation.com/t/print-two-page-report/5916/1 "2013-02-22T19:45:33Z")

</div>

I am using the following script to print a two page report:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [February 22, 2013, 8:20pm UTC](https://forum.inductiveautomation.com/t/print-two-page-report/5916/2 "2013-02-22T20:20:52Z")

</div>

It should print both pages. Maybe the report hasn’t completed when you run the script?

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [February 22, 2013, 9:05pm UTC](https://forum.inductiveautomation.com/t/print-two-page-report/5916/3 "2013-02-22T21:05:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [February 23, 2013, 12:24am UTC](https://forum.inductiveautomation.com/t/print-two-page-report/5916/4 "2013-02-23T00:24:06Z")

</div>

I think the best way to tackle this is by using an invokeLater to give it a little bit of time to complete.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [February 23, 2013, 12:28am UTC](https://forum.inductiveautomation.com/t/print-two-page-report/5916/5 "2013-02-23T00:28:48Z")

</div>

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.
