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 Table of Contents object.
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 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
Do the following:
-
Select an object in your template.
-
Click the bold f icon near the object to open the Expression Editor.
-
In the left panel in the Expression Editor, click Bookmark.
-
Enter an expression to define the bookmark.
Tip noteFor 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 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.
Do the following:
-
From the toolbox panel on the right side of the designer, drag a 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 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 Properties menu for the Table of Contents. Expand Behavior > Level Title, and configure Font and other settings.
-
Content entries: Open the 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.
Do the following:
-
Create a new PixelPerfect template.
-
Open the Field List menu available from the right-side panel in the designer.
-
Click the plus icon next to Levels.
-
Expand Fields, and click the icon next to Region.
The data binding is added.
-
You are brought back to the main Field List menu. Click the plus icon next to Images.
-
Expand the Dashboard sheet, and click the icon next to the Top 5 Customers chart.
The data binding is added.
-
Right-click the Detail1 band, and then click Insert Band > DetailReport.
-
To bind the DetailReport1 band to the level, select the band and then open the Properties menu. Under Detail Report Tasks > Data Member, select the Region level.
-
Open the Field List menu, and double-click Levels to expand it.
-
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.
-
In the Field List menu, double-click Images to expand it.
-
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
Do the following:
-
Select the Region label you added earlier.
-
Click the bold f icon near the label to open the Expression Editor.
-
Select and copy the expression that is currently shown: [Region (Region_Level).Region]
-
In the left panel in the Expression Editor, click Bookmark.
-
Paste the copied expression into the editor.
The bookmark is created.
Part 2: Create the Table of Contents
Do the following:
-
From the toolbox panel on the right side of the designer, drag a Table of Contents onto the design surface.
The Table of Contents is added on a newly created ReportHeader band.
-
Style the object as desired (for example, you can adjust some of the properties mentioned here).
-
In the top right corner, click Save template.
-
Click Preview report. Download the report and open it.