# Does excuteReport invoke Report "Run Script" Action?

**URL:** <https://forum.inductiveautomation.com/t/does-excutereport-invoke-report-run-script-action/52880>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [November 9, 2021, 4:33pm UTC](https://forum.inductiveautomation.com/t/does-excutereport-invoke-report-run-script-action/52880 "2021-11-09T16:33:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 9, 2021, 4:33pm UTC](https://forum.inductiveautomation.com/t/does-excutereport-invoke-report-run-script-action/52880/1 "2021-11-09T16:33:31Z")

</div>

I have a report with a run script action setup that I want to invoke using `system.report.executeReport()`. I don’t need to distribute the report, just force run the script the report contains. When I execute the report, nothing happens and no errors in the logs. If I manually run the script from inside the report, it works fine. So I’m wondering if the script is even executing when calling `system.report.executeReport()`.

If it doesn’t, I guess I could setup a shared script and call that from the report script and anywhere else I need it. Still curious on why executing didn’t run the script.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 9, 2021, 4:44pm UTC](https://forum.inductiveautomation.com/t/does-excutereport-invoke-report-run-script-action/52880/2 "2021-11-09T16:44:50Z")

</div>

It doesn’t get invoked, I setup a logger and it only prints the logs to the gateway when run from inside the report. I’m `surprised executeReport()` doesn’t get invoked, I guess because the “Run Script” action is only ran from a scheduled event.

---

<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:** [November 9, 2021, 5:30pm UTC](https://forum.inductiveautomation.com/t/does-excutereport-invoke-report-run-script-action/52880/3 "2021-11-09T17:30:30Z")

</div>

> [@dkhayes117](#):
>
> I guess because the “Run Script” action is only ran from a scheduled event.

That's exactly why.

If you need a script to run every time the report is executed, why not just put your code into a script data source? There's no 'rule' that you have to actually add new datasources there.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 9, 2021, 5:34pm UTC](https://forum.inductiveautomation.com/t/does-excutereport-invoke-report-run-script-action/52880/4 "2021-11-09T17:34:46Z")

</div>

> [@paul-griffith](#):
>
> why not just put your code into a script data source

Very true, I didn't think of that.
