Adding a Table of Contents in a Report
You can add a table of contents in a page or web report, to enable easy navigation of the report content when previewing the report in Designer and in the report outputs. This topic describes how to add a Table of Contents in a report.
- Open the report, and for a page report, switch to the page report tab.
- Select an existing page panel in the Report Inspector, then do either of the following:
- Navigate to Insert > TOC Page.
- Right-click in any blank area in the page panel in the design area and select Insert > TOC Page from the shortcut menu.
Designer displays the Insert TOC Page dialog box.
- Specify where you want to place the TOC, before or after the current page panel.
- Designer adds a table of contents in the report at the specified location, and automatically creates a TOC page panel to position the TOC.
- In the Report Inspector, specify the TOC Anchor and Anchor Display Value properties of the objects in the report that you want to add in the TOC. Basically, you can include data components, tabulars, text boxes, group panels in banded object, and DBFields, formula fields, parameter fields, images, and labels inside banded objects in the TOC. However, the objects should be in page panels that are after the TOC page panel, so Designer can create TOC entries for them.
- You can select the node representing the web report or page report tab and set the Ignore TOC Anchor of Parent and Continuous Page Number with TOC properties.
- Double-click the TOC or right-click it and select Format from the shortcut menu. Designer displays the Format TOC Title & Levels dialog box.
- In the Title text box, type the text you want to display as the title of the TOC, then specify the font style and spacing of the title.
- Select Add to add a TOC level and specify the font style, spacing, leader character, and other options for TOC entries of this level.
- Repeat the preceding step to add more TOC levels and edit the formatting of each level.
- Select OK to finish customizing the TOC style.
You can also specify the style of the TOC by setting properties of the TOC in the Report Inspector. However, once you define the formatting for the TOC title or TOC entries in any level in the Format TOC Title & Levels dialog box, it overrides the formatting specified in the Report Inspector.
- You can insert the TOC Page Number special field in the header or footer of the TOC page panel to display page number for the TOC. Report Engine calculates the number for the TOC pages differently than the report pages.
By default, Designer does not show the header or footer of the TOC page panel. To insert objects in them, you need to first edit their Invisible property to "true", or you can select in the TOC page and navigate to View > Page Header/Page Footer.
- Select the View tab to preview the report and select Show TOC Page to display the table of contents in the report.
- Select an item in the TOC and Designer opens the page containing the corresponding object.
After adding TOC in a report, when you export or print the report in Designer or at runtime, and when you run the report in advanced mode or schedule to run it in formats except Web Report for a web report, you can also use the TOC in the report output to easily locate the content you need to focus on.
In addition to the table of contents generated by inserting the TOC Page object, Designer also provides the TOC object for each page report tab and web report in the Report Inspector. This TOC object corresponds to the TOC tree of the report. When you add an object in the table of contents of a report, you also include the object in its TOC tree. You can view the TOC tree of a report in the following scenarios:
- When previewing the report in Designer, you can select TOC on the View tab toolbar to display the TOC tree.
- When exporting the report to HTML and PDF in Designer, you can select the TOC option to enable displaying the TOC tree in the Table of Contents panel of the PDF and HTML browsers.
- At runtime, you can view the TOC tree in the TOC Browser of Page Report Studio when running a page report.