# Trigger Report Without a Time-Based Schedule

**URL:** <https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [November 17, 2017, 7:25pm UTC](https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039 "2017-11-17T19:25:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel.desimone](https://avatars.discourse-cdn.com/v4/letter/d/3da27b/32.png) [@daniel.desimone](https://forum.inductiveautomation.com/u/daniel.desimone)\
**Post date:** [November 17, 2017, 7:25pm UTC](https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039/1 "2017-11-17T19:25:40Z")

</div>

I need to generate PDF reports at the end of a process, which can be run at any time of day. The way it needs to operate is that when an integer is above a set value, a report is generated and saved as a PDF somewhere in the file system, independent of the time.

I have a hacky way of getting the .saveAsPDF() function to trigger (system.gui.getWindow()), however this just brings up the dialog box for selecting a destination on the client, whereas I need the file fully generated without user input and stored on the server (or email or whatever, just something). I’ve also tried the print option and setting the default printer to PDF, but that printer driver still just brings up a dialog box and guess what, now the dialog is on the server instead of the client computer (if it works at all).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 17, 2017, 7:32pm UTC](https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039/2 "2017-11-17T19:32:36Z")

</div>

The scripting function [system.report.executeAndDistribute()](https://docs.inductiveautomation.com/display/DOC79/system.report.executeAndDistribute) with the “save” action seems to fit your needs. Run it from a tag change event that monitors your trigger integer.

---

<div class="post-metadata">

**Author:** ![daniel.desimone](https://avatars.discourse-cdn.com/v4/letter/d/3da27b/32.png) [@daniel.desimone](https://forum.inductiveautomation.com/u/daniel.desimone)\
**Post date:** [November 17, 2017, 7:38pm UTC](https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039/3 "2017-11-17T19:38:02Z")

</div>

YES that’s exactly what I needed, thank you very much! You just saved my bacon.

---

<div class="post-metadata">

**Author:** ![daniel.desimone](https://avatars.discourse-cdn.com/v4/letter/d/3da27b/32.png) [@daniel.desimone](https://forum.inductiveautomation.com/u/daniel.desimone)\
**Post date:** [November 17, 2017, 7:45pm UTC](https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039/4 "2017-11-17T19:45:04Z")

</div>

Just tested it and yup this went off without a hitch. Thanks again!

---

<div class="post-metadata">

**Author:** ![Ehren](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ehren/32/3367_2.png) [@Ehren](https://forum.inductiveautomation.com/u/Ehren)\
**Post date:** [November 17, 2017, 8:12pm UTC](https://forum.inductiveautomation.com/t/trigger-report-without-a-time-based-schedule/16039/5 "2017-11-17T20:12:35Z")

</div>

Ha, what a coincidence, I was actually just looking for the same thing.  
Thanks pturmel!!
