The TableOfContents control allows you to display the document map, an organized hierarchy of the report bookmark labels and heading levels along with their page numbers, in the body of a report.
To add items to the Document Map using HeadingLevel Property
You can define an hierarchical structure for your report using the HeadingLevel property of the TextBox control. For example, you can set the HeadingLevel property of the TextBox displaying the report title to Heading1 and then set the HeadingLevel property of the TextBox displaying a group header to Heading2, this will club all the Heading2 entries under the Heading1 entry in the Document Map.
These steps assume that you have already set the HeadingLevel property of the TextBox controls that your report contains. See, Add Items to the Document Map for more information.
- In the Report Explorer, right-click the Report item and select Report Properties...
- In the Report Properties dialog that appears, go to the Document Map page.
- On the Document Map page, set Source to Headings Only and optionally select the Numbering Style from the dropdown list.
Tip: You can also set Source to Labels and Headings to include both labels and headings in the Document Map.
- Click OK to close the dialog.
To add items to the Document Map using Label Property or Document Map Labels
By setting the Label property or Document Map Label of the controls in your page report/RDL report, you can show a hierarchical structure based on the parent - child relationship between the controls in the Document Map. For example, set the Label property or Document Map Label of a List data region and a TextBox control and then place the TextBox control inside the List data region. When you view the Document Map, the TextBox label appears nested inside the List data region label, thereby displaying a hierarchical structure. Similarly, if you set a Document map label on multiple Groups of a data region, they appear nested below each other in the document map displaying the same hierarchy in which they were set.
These steps assume that you have already set the Label property or Document Map Label of the controls that your report contains. See, Add Items to the Document Map for more information.
- In the Report Explorer, right-click the control and select Report Properties...
- In the Report Properties dialog that appears, go to the Document Map page.
- In the Document Map page, set Source to Labels Only and optionally select the Numbering Style from the dropdown list.
Tip: You can also set Source to Labels and Headings to include both labels and headings in the Document Map.
- Click OK to close the dialog.
To add items to the Document Map using
- On the , select a control you want to add to the Document map.
- In the command section of the Properties Window, click the Property dialog. This is a command to open the control's dialog. See Properties Window for more information on how to access commands.
- In the dialog that appears, go to the Navigation page and under the Document map label, enter a text or an expression representing the control in the Document map.
- Click OK to close the dialog.
To add and configure TableOfContents
Follow these steps to setup the TableOfContents control in the report layout displaying the document map set in the procedures above.
To add a TableOfContents control in
- In the Report designer, click the New tab to add a new page to the report layout.
- From the toolbox, drag and drop the TableOfContents control onto Page 1 while use Page 2 to create layout for displaying the main content of the report. Using the same page that contains the TableOfContents may disrupt the flow of data displayed in the report.
- On the design surface, select the TableOfContents control and go to the Properties window to set its FixedHeight property. The use of the FixedHeight property is similar to the use of the property that is available with other report controls.
Note: You can also place the
OverflowPlaceHolder control and link it with the TableOfContents control using its
OverflowName property to display data that does not fit inside the fixed size of the TableOfContents control.
- With the TableOfContents control selected, click the Levels (Collection) property and then click the ellipsis button that appears.
- In the LevelDesigner Collection Editor that appears, consider the hierarchy of entries that appear in the Document Map and add as many levels required using the Add button. This allows you to customize entries at different nested levels. Using just a single Level will list down all the TableOfContents entries at the same level. You can also set various numbering styles for all levels or an individual level by setting the Numbering Style for document map levels using the Report dialog or using the DocumentMap property that gets directly applied to the TableOfContents control. For more information see Add Items to the Document Map.
- Select each level and set its related properties available in the LevelDesigner Collection Editor. These properties could be general properties like DisplayPageNumber or DisplayFillCharacter, or they could be related to the level's appearance like BackgroundColor, Font, Padding etc. These properties directly affect all the entries that appear in the selected level, thereby allowing you to customize them. For information on the important properties of the TableOfContents control, see TableOfContents.
- Click OK to close the dialog and return to the design surface.
- Go to the to view the Table of Contents appear in the report output.
- Click any TableOfContents entry and navigate to the targeted report control in the report.
To add a TableOfContents control in Report Definition Language ()
- From the toolbox, drag and drop the TableOfContents control onto the report , preferably at the start or end of the report layout to justify the significance of the control.
To configure TableOfContents Appearance
- With the TableOfContents control selected, click the Levels (Collection) property and then click the ellipsis button that appears.
- In the LevelDesigner Collection Editor that appears, consider the hierarchy of entries that appear in the Document Map and add as many levels required using the Add button. This allows you to customize entries at different nested levels. Using just a single Level will list down all the TableOfContents entries at the same level.
- Select each level and set its related properties available in the LevelDesigner Collection Editor. These properties could be general properties like DisplayPageNumber or DisplayFillCharacter, or they could be related to the level's appearance like BackgroundColor, Font, Padding etc. These properties directly affect all the entries that appear in the selected level, thereby allowing you to customize them. For information on the important properties of the TableOfContents control, see TableOfContents.
Note: You can also set various numbering styles for all levels or individual level by setting the
Numbering Style for document map levels using the Report dialog or using the
DocumentMap property that gets directly applied to the TableOfContents control. For more information see
Add Items to the Document Map.
- Click OK to close the dialog and return to the design surface.
- Go to the to view the Table of Contents appear in the report output.
- Click any TableOfContents entry and navigate to that targeted report control in the report.
To apply styles to the TableOfContents control
In the TableOfContents control, styles can be applied using the StyleName property.
- Create a new style sheet and add styles that you want to apply to the TableOfContents control. For more information on creating style sheets and style types, see Working with Styles and Style Elements.
- Apply the style sheet to the report. For details on how to apply style sheets to reports at design time, see Working with Styles.
- From the toolbox, drag and drop the TableOfContents control onto the report , preferably at the start or end of the report layout to justify the significance of the control.
- On the design surface, select the TableOfContents control.
- In the Properties Window, from the StyleName property drop-down, select a style to apply to the TableOfContents control.
To apply styles to the TableOfContents levels
In the TableOfContents control, styles can be applied to each TableOfContents level using the StyleName property available in the LevelDesigner Collection Editor dialog.
- Create a new style sheet and add styles that you want to apply for the TableOfContents level. For more information on creating style sheets and and the type of styles available for TableOfContents level, see Working with Styles and Style Elements.
- From the toolbox, drag and drop the TableOfContents control onto the report , preferably at the start or end of the report layout to justify the significance of the control.
- With the TableOfContents control selected, click the Levels (Collection) property from the Properties window and then click the ellipsis button that appears.
- In the LevelDesigner Collection Edior dialog that appears, select a TableOfContents level on which to want to apply the style.
- From the list of properties on the right, drop-down the StyleName property to select a style to apply.
See Also