Example 4. Report with table of contents, navigation and outline |
Top Previous Next |
In this example, we will look at creating a report, which has the following features:
The report will use the "Categories" and "Products" tables. In the TOC, we will print the categories list. The rest of report will print the categorized list of products. Report template will be made up of two pages: the first page will be used to print the TOC; the second one is the main part of the report.
We will discuss the TOC firstly. Create a new report and add "Categories" and "Products" data sources into it. Connect the "Data" band to the "Categories" table and place the objects in the following way:
In order to make the TOC objects interactive, configure its "Hyperlink" property:
Indicate the category name as a bookmark. We will define the object's bookmark later.
In order to print the page number in the TOC, you need to do the following:
[Engine.GetBookmarkPage([Categories.CategoryName])]
On the second page of the report, we will create a master-detail report as shown in the figure below:
Set up the bookmark we navigate to when clicking on an element in the TOC. For this, select the first "Data" band and indicate the following expression in its "Bookmark" property:
[Categories.CategoryName]
To set up the report outline, do the following:
"Contents"
[Categories.CategoryName]
[Products.ProductName]
|