# How to generate multiple report pages, based on an SQL count result

**URL:** <https://forum.inductiveautomation.com/t/how-to-generate-multiple-report-pages-based-on-an-sql-count-result/83684>\
**Category:** Ignition\
**Tags:** ignition81, scripting, reporting, perspective\
**Created:** [January 2, 2024, 2:27pm UTC](https://forum.inductiveautomation.com/t/how-to-generate-multiple-report-pages-based-on-an-sql-count-result/83684 "2024-01-02T14:27:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_Hofmann](https://avatars.discourse-cdn.com/v4/letter/l/85e7bf/32.png) [@Luca\_Hofmann](https://forum.inductiveautomation.com/u/Luca_Hofmann)\
**Post date:** [January 2, 2024, 2:27pm UTC](https://forum.inductiveautomation.com/t/how-to-generate-multiple-report-pages-based-on-an-sql-count-result/83684/1 "2024-01-02T14:27:17Z")

</div>

Hello,

im new to the Reporting Module and can't really find an answer to following question.  
I have a SQL Query as Datasource which returns the amount of assets in a certain department. Lets say department XYZ has 5 assets.

I now have a second Query that returns for every of those 5 assets specific Information.  
Now i need to display those query results for each asset on a own page.

Basicaly i want to dynamicly create pages based on the amount of assets i have (each page shows data for one asset) . I could do it manually but that would take ages since the amount of assets per department is a lot more than 5.

Not sure if thats even possible, so i appreciate any tipp that guides me in the right direction.

Thank you in advance,

Luca

---

<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:** [January 2, 2024, 2:39pm UTC](https://forum.inductiveautomation.com/t/how-to-generate-multiple-report-pages-based-on-an-sql-count-result/83684/2 "2024-01-02T14:39:59Z")

</div>

That would be a "table group". The group would use the outer key, and the per-asset part would use the inner key.

---

<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:** [January 2, 2024, 2:40pm UTC](https://forum.inductiveautomation.com/t/how-to-generate-multiple-report-pages-based-on-an-sql-count-result/83684/3 "2024-01-02T14:40:08Z")

</div>

I think your best bet would be to use a single data source in a table and configure table grouping based on asset. The table will handle pagination automatically, but I'm not sure if you can force it to a new page when the asset changes.  
[Report Tables - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/Report+Tables)
