# Report Dynamic Table of Contents

**URL:** <https://forum.inductiveautomation.com/t/report-dynamic-table-of-contents/30576>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [December 10, 2019, 4:50pm UTC](https://forum.inductiveautomation.com/t/report-dynamic-table-of-contents/30576 "2019-12-10T16:50:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.willbanks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nathan.willbanks/32/8489_2.png) [@nathan.willbanks](https://forum.inductiveautomation.com/u/nathan.willbanks)\
**Post date:** [December 10, 2019, 4:50pm UTC](https://forum.inductiveautomation.com/t/report-dynamic-table-of-contents/30576/1 "2019-12-10T16:50:52Z")

</div>

I’m creating a Report using a Table Group for each “Report Section” (5 Sections total). Because the Table Group adds pages as necessary, the page number on which each section begins is not always the same.

Does anyone know of a way to create a “Table of Contents” where I can dynamically reference the page number that each new Section starts on for each report I print?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [December 10, 2019, 7:48pm UTC](https://forum.inductiveautomation.com/t/report-dynamic-table-of-contents/30576/2 "2019-12-10T19:48:37Z")

</div>

You might get some inspiration here: [PDF report linking](http://forum.inductiveautomation.com/t/pdf-report-linking/18860)

---

<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:** [December 10, 2019, 8:28pm UTC](https://forum.inductiveautomation.com/t/report-dynamic-table-of-contents/30576/3 "2019-12-10T20:28:40Z")

</div>

Huh. Wow.

So, turns out this is _also_ possible.  
Adapting from [ReportMill - Table of Contents](http://www.reportmill.com/support/TableOfContents.html)

1. Add a new page (Pages → Add Page Previous)
2. Create a new table. Give it a data key of _exactly_ `TOC.<dataKey>.<dataKey>`
3. Add cells to the details row. Use the existing builtin `@Row@` for the row _within_ the table, the unique-to-table-of-contents `@page@` to refer to the _page that a particular key exists on_, and just use `@<columnName>@` to refer to values from the actual grouping key.
4. Preview the report - the reporting engine should automatically recognize the `TOC` key and insert a table of contents.

To test, I’m using a simple SQL query (`SELECT * FROM SQLTH_TE`) with a table set up so that I end up with a few rows per page, but always multiple pages.  
My table of contents table looks like this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b063939971878253c7685812429a5a708604a796.png)

And the rendered output looks like this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/ab86b45bc8d2e91c785ae00c2d3ce6efd376ee32.png)
