Skip to main content Skip to complementary content

Adding a table of contents

You can add a table of contents to a header or footer band in your report. Selecting an item in the table of contents will bring the reader to the specified location in the PDF. Create a table of contents using PixelPerfect bookmarks and the Database icon with plus symbol Table of Contents object.

Table of contents

Sample report showing a table of contents, with an entry in the list for each product group

Bookmarks

PixelPerfect bookmarks help with navigation through the structural arrangement of report elements. In particular, they are used as mappings for tables of contents.

You need to add a bookmark for each item you want to add to your table of contents. You can add a bookmark for essentially any type of data binding available in the designer.

For information about to create a bookmark and link it to a table of contents, see Workflow.

Table of Contents

The Database icon with plus symbol Table of Contents object is available from the toolbox panel on the left side of the PixelPerfect designer. You need to have at least one bookmark in your template for the table of contents to generate correctly.

The Table of Contents displays the text value of each bookmark you add for an object. When you use levels along with an object that is used as bookmark, the Table of Contents will contain a navigation item for each element cycled in the level.

The Table of Contents can only be placed in ReportHeader and ReportFooter bands. You can manually create one of those bands and drag and drop the object onto it. Alternatively, directly drag and drop the object onto the template and the ReportHeader band will be created automatically.

When you add a Table of Contents object, it is automatically separated onto its own pages by page breaks.

Workflow

This is the recommended workflow for adding a table of contents to your report. Before you begin this workflow, it is assumed that you have at least one object in your report template that can be used as a bookmark.

Part 1: Create a bookmark

  1. Select an object in your template.

  2. Click the bold f icon near the object to open the Expression Editor.

  3. In the left panel in the Expression Editor, click Bookmark.

  4. Enter an expression to define the bookmark.

    Tip note

    For example, if the bookmark corresponds to a level created from a field named Product Group, you can type it as follows: [Product Group].

    You can also add hard-coded text to the bookmark by typing something like the following:

Alternatively, you can create a bookmark by clicking the Database icon with plus symbol icon on the right side of the designer. Enter the expresison in the Bookmark menu field.

Tips for bookmark expressions

The expression you enter for your bookmark depends on what you want displayed in your table of contents.

For example, if the bookmark corresponds to a level created from a field named Product Group, you can type it as follows: [Product Group]

You can also add hard-coded text to the bookmark by typing something like the following: ='Insert your text here'

Part 2: Create the Table of Contents

Before you start, decide where you want to place the table of contents. If you want to add it in the report header, add a ReportHeader band. If you want to add it to the report footer, add a ReportFooter band.

  • From the toolbox panel on the right side of the designer, drag a Database icon with plus symbol Table of Contents onto the ReportHeader or ReportFooter band.

After you add the Table of Contents, you can customize its look and feel. Here are some examples:

  • Reposition the bar separating the title and contents, to add more or less space between them.

  • Change the text of the title. Open the Gear Properties menu for the Table of Contents. Expand Behavior > Level Title, and insert your text in the Text box.

  • Change the font and other appearance properties for:

    • Title area: Open the Gear Properties menu for the Table of Contents. Expand Behavior > Level Title, and configure Font and other settings.

    • Content entries: Open the Gear Properties menu for the Table of Contents. Expand Behavior > Level Default, and configure Font and other settings.

Example - Table of contents with level

Refer to the example app sources here: Example materials - In-app reporting. Upload the app and data files into a space, and then reload the app. You are ready to complete the example.

Preparation: Create content

Create some content by adding a chart image, level, and label.

  1. Create a new PixelPerfect template.

  2. Open the Database icon with plus symbol Field List menu available from the right-side panel in the designer.

    Field List menu in the PixelPerfect designer

    The 'Field List' menu expanded from the right side panel in the PixelPerfect designer
  3. Click the plus icon next to Levels.

  4. Expand Fields, and click the Plus icon next to Region.

    The data binding is added.

  5. You are brought back to the main Database icon with plus symbol Field List menu. Click the plus icon next to Images.

  6. Expand the Dashboard sheet, and click the Plus icon next to the Top 5 Customers chart.

    The data binding is added.

  7. Right-click the Detail1 band, and then click Insert BandDetailReport.

  8. To bind the DetailReport1 band to the level, select the band and then open the Gear Properties menu. Under Detail Report TasksData Member, select the Region level.

  9. Open the Database icon with plus symbol Field List menu, and double-click Levels to expand it.

  10. For Region, expand the level object and drag the Region field within it onto the DetailReport1 band.

    Position the label at the top of the band.

  11. In the Database icon with plus symbol Field List menu, double-click Images to expand it.

  12. Drag Top 5 Customers onto the DetailReport1 band, placing it below the label.

You can customize and style the content as desired.

Part 1: Create a bookmark

  1. Select the Region label you added earlier.

  2. Click the bold f icon near the label to open the Expression Editor.

  3. Select and copy the expression that is currently shown: [Region (Region_Level).Region]

  4. In the left panel in the Expression Editor, click Bookmark.

  5. Paste the copied expression into the editor.

    Creating a PixelPerfect bookmark

    The Expression Editor showing the 'Bookmarks' configuration being edited. 'Bookmarks' is selected in the left side panel. The bookmark expression is entered in the editor as well

The bookmark is created.

Part 2: Create the Table of Contents

  1. From the toolbox panel on the right side of the designer, drag a Database icon with plus symbol Table of Contents onto the design surface.

    The Table of Contents is added on a newly created ReportHeader band.

  2. Style the object as desired (for example, you can adjust some of the properties mentioned here).

    Report template with Table of Contents

    Report template showing a ReportHeader band that contains a Table of Contents placeholder. The Table of Contents will draw from the content in the DetailReport band (specifically the 'Region' level)
  3. In the top right corner, click Save template.

  4. Click Preview report. Download the report and open it.

Report preview with Table of Contents

Generated report showing the Table of Contents, with items for each region value, along with their page numbers

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!