# Report Schedule Through Scripting

**URL:** <https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [May 16, 2025, 7:55pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350 "2025-05-16T19:55:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted\_Schlepuetz](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@Ted\_Schlepuetz](https://forum.inductiveautomation.com/u/Ted_Schlepuetz)\
**Post date:** [May 16, 2025, 7:55pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/1 "2025-05-16T19:55:11Z")

</div>

Is it possible to change a report schedule through scripting? This was asked a few years ago just checking to see if anything has changed over the versions.

> [@Change Report Schedule parameters with scripting](https://forum.inductiveautomation.com/t/change-report-schedule-parameters-with-scripting/43633):
>
> Hello everyone, I have some reports in Ignition, I wonder if there is a way to change these parameters in highlighted through scripting ? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 16, 2025, 10:11pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/2 "2025-05-16T22:11:55Z")

</div>

No, there is not, but if you need **dynamic** scheduling (configurable at runtime by end users) I can think of a few ways to do it.

For instance, you could have a gateway timer script that runs e.g. once a minute, checks whether the current minute lines up with a scheduled time (in a database, perhaps) and then uses [`system.report.executeAndDistribute`](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-report/system-report-executeAndDistribute) to generate your report dynamically.

---

<div class="post-metadata">

**Author:** ![Ted\_Schlepuetz](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@Ted\_Schlepuetz](https://forum.inductiveautomation.com/u/Ted_Schlepuetz)\
**Post date:** [May 16, 2025, 10:38pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/3 "2025-05-16T22:38:29Z")

</div>

Looking at that function it states that the thread could get blocked.

Is that also an issue when the reports are scheduled through the normal methods?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 16, 2025, 10:47pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/4 "2025-05-16T22:47:22Z")

</div>

No, but you can always wrap your invocation of `executeAndDistribute` in `system.util.invokeAsynchronous` to run it on a new thread.

---

<div class="post-metadata">

**Author:** ![Ted\_Schlepuetz](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@Ted\_Schlepuetz](https://forum.inductiveautomation.com/u/Ted_Schlepuetz)\
**Post date:** [May 19, 2025, 1:11pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/5 "2025-05-19T13:11:27Z")

</div>

Do we need to do anything to clean up that new thread after the report is done running?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 19, 2025, 3:16pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/6 "2025-05-19T15:16:48Z")

</div>

No. As long as the function provided to invokeAsynchronous exits, the thread will be automatically cleaned up. Just don't pass any custom functions with an infinite loop or similar.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 19, 2025, 8:29pm UTC](https://forum.inductiveautomation.com/t/report-schedule-through-scripting/106350/7 "2025-05-19T20:29:05Z")

</div>

> [@Ted\_Schlepuetz](#):
>
> Looking at that function it states that the thread could get blocked.

That caution has been there for a while (pre-Perspective). If you run it in a Vision client without calling it through an asynchronous function, it would run in the GUI thread. That blocks anything else happening in the client until it was done.

Using a gateway scoped event, as mentioned by @paul-griffith, you can set it to run in a dedicated thread.
