# Reporting - Is There Templates?

**URL:** <https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407>\
**Category:** Ignition\
**Created:** [August 13, 2019, 6:00pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407 "2019-08-13T18:00:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 13, 2019, 6:00pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407/1 "2019-08-13T18:00:13Z")

</div>

I have a report made that is scheduled and sent at month end to one person. But now I need almost the same report sent to more people. Basically the only thing that changes is the SQL query’s WHERE clause for that specific person and obviously the recipients email.

Instead of making a bunch of different reports for each person is there some sort of template I could make? I’m hoping to avoid making 100 reports and then have to make a change to all of them eventually.

Or maybe there’s some alternative way?

Thanks!

---

<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:** [August 13, 2019, 6:03pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407/2 "2019-08-13T18:03:32Z")

</div>

Feed in the username and the email address as parameters, then run the queries yourself using [`system.report.executeAndDistribute`](https://docs.inductiveautomation.com/display/DOC80/system.report.executeAndDistribute).

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 13, 2019, 6:09pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407/3 "2019-08-13T18:09:09Z")

</div>

ohhh okay, that looks promising. I’ll look into that further.

Where would I call that? And how do I pass in a parameter to change the SQL query?

---

<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:** [August 13, 2019, 6:12pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407/4 "2019-08-13T18:12:53Z")

</div>

In the report designer, in a SQL Query datasource, if you type a `?` it will automatically open a parameter substitution dialog that lets you bring in report parameter values:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/56ad9f02df46c748ece910c37fcccec4fd963b91.png)

You would just run the script once from the gateway - maybe a timer script that runs ever hour, checks if it’s on the right date (of month) and time (of day, depending on when you actually want this sent out).  
Then, in the script, either have a hardcoded list, or retrieve (however you need to do so) the list of users to send this report out to. Then loop through that list, `executeAndDistributing` the generated report.

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 13, 2019, 6:20pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407/5 "2019-08-13T18:20:00Z")

</div>

ok, I’ll give that a shot… Thank you!

I can’t seem to get that Parameter list to show up though. Not sure if it’s hidden somehow? I am on 8.0.3.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/acd65a759853faca3d375ab814d722495cc4642c.png)

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 13, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/reporting-is-there-templates/27407/6 "2019-08-13T18:35:59Z")

</div>

oops sorry, just realized I forgot the **?**
