Sometimes when you create large (PDF-) documents with Cognos, it can be useful to add a table of contents at the beginning. For this Cognos supports a special toolbox object (since version 8.3). Unfortunately this object only works for PDF reports.
First of all we need a report with multiple pages. We create a report with a repeater table. Within this repeater table we create a simple list. This list contains all articles of a product group. We also put the product group label in the repeater table above the list. The result should look similar to this:
Now we create on a separate page (we put this page in front of the report main page) the table of content. For that we just put the table of content object on the report page. It should look something like that:
The second step is to put the “entry of table of content” object in front of the product group label on the report page. So go to the report page and add the entry as described in the screenshot:
Now go back to the TOC page. There you have to change the text source on the entry in the table of contents. Switch the source type property to „Date item value“ and then select the Productline. It should look like this:
Now your report is ready to be tested. Keep in mind that you run it as PDF output, otherwise you won’t see anything in the table of contents.
This was a very simple table of contents. If you want to create a table of contents based on your products instead of productlines you can unlock the report view and then move the “entry of table of content” element in the products column. Furthermore you have to change the data item in the table of contents entry to product now and you table of contents is created based on the products.
You can also create some kind of structured table of content where you have entries for product groups and products just by combining both methods and using the „Heading Level“ property on the entry in the TOC.
I hope this article gave you an overview how to easily build table of contents in Cognos.
If you are interested in this or other advanced Cognos/SQL topics you can also attend training on my corporate homepage. At the moment my open courses are only available in German. Inhouse training and online courses are also available in English language. So check out my open trainings (German) or my online courses (English)!