Example - Add a Table of Contents to a Report
You are a report author at The Sample Outdoors
Company, which sells sporting equipment. You are requested to add
a table of contents to an existing report so that users can more easily
navigate your report.
Procedure
- Open IBM® Cognos® Report Studio with the GO Data Warehouse (analysis) package.
- Open the Budget vs. Actual sample report from the Report Studio Report Samples folder.
- Create the report pages:
- Pause the pointer over the page explorer button and click Report Pages.
- Click Page1, and then, in the Properties pane, set the Name property to Budget vs. Actual Sales.
- Click the Budget vs. Actual Sales page and, from the Edit menu, click Copy.
- From the Edit menu, click Paste to paste the copy of the page in the Report Pages pane.
- Select the new page, and in the Properties pane, set the Name property to Table of Contents.
- In the Report Pages pane, drag the Table of Contents page to the top of the list.
- Pause the pointer over the page explorer button and click Table of Contents.
- Delete the crosstab object:
- Click somewhere in the report page.
- In the Properties pane, click the select
ancestor button and click Crosstab.Tip: You can also click the container selector (three orange dots) of the crosstab to select it.
- Click the delete button .
- Select the Camping Equipment block object and click the delete button.
- Double-click the report title, type Table of Contents, and click OK.
- From the Toolbox tab , drag a Table of Contents object onto the page.
- Pause the pointer over the page explorer button and click Budget vs. Actual Sales.
- From the Toolbox tab, drag a Table of Contents Entry object to the left of each region.
- Pause the pointer over the page explorer button and click Table of Contents.
- Double-click the first entry in the table of contents, type Americas, and click OK.
- Rename the other table of contents entries as Asia Pacific, Northern Europe, Central Europe, and Southern Europe.
- Save the report.
- Number the table of contents entries:
- From the Toolbox tab, drag a Layout Calculation object to just before the word Americas.
- In the Report Expression dialog box, on the Functions tab , expand the Report Functions folder and double-click the TOCHeadingCount expression.
- At the end of the expression definition, type 1) and click OK.
- Repeat the previous three steps to add layout calculations before the other table of contents entries.
- Ctrl+click only the five table of contents entries and not the five layout calculations.
- In the Properties pane, double-click the Padding property and set the left padding to 10 px.
- Change the color of table of contents entries:
- Ctrl+click the five layout calculations, the five table of contents entries, and the five page number calculations.
- In the Properties pane, double-click the Foreground Color property and set the foreground color to blue.
- Add links to the table of contents from another page:
- From the Toolbox tab, drag a Bookmark object to just before the title.
- Select the bookmark and, in the Properties pane, double-click the Label property, type TOC, and click OK.
- Pause the pointer over the page explorer button and click Budget vs. Actual Sales.
- From the Toolbox tab, drag a Text Item object to the right of the crosstab object.
- In the Text dialog box, type Return to the Table of Contents and click OK.
- Right-click the text object and click Drill Through Definitions.
- Click the add button .
- On the Bookmark tab, in the Source Type list, click Text.
- Click the ellipsis button, type TOC, and then click OK twice.
- Save the report.
- Click the arrow to the right of the run report button and click Run Report - PDF.
Results
Parent topic: Create a Table of Contents