Report Dynamic Table of Contents

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?

You might get some inspiration here: PDF report linking

Huh. Wow.

So, turns out this is also possible.
Adapting from

  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:

And the rendered output looks like this: