Skip to main content
A newer version of this page is available. .

XRTableOfContents Class

A Table of Contents that is auto-generated based on the hierarchy of bookmarks contained in a report’s document map.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core

Declaration

public class XRTableOfContents :
    XRFieldEmbeddableControl

Remarks

Once bookmarks have been assigned to specific report elements, you can generate a table of contents that displays page numbers containing the elements included into the document map.

The following image illustrates the difference in displaying information by a table of contents within a report and in a published document.

Table-of-Contents-Concepts00

To implement a table of contents, drop the XRTableOfContents control from the Toolbox DX.20.2: Report Controls tab onto the report surface. If the report does not contain a Report Header at the moment, it will be created automatically so that the table of contents can be added to it.

Table-of-Contents-Concepts01

Table of Contents Structure

The table of contents contains the following elements.

  1. A title (corresponding to the XRTableOfContentsTitle class) that displays text and formatting options specified by the XRTableOfContents.LevelTitle property.
  2. One or more document levels (corresponding to the XRTableOfContentsLevel class) that provide individual formatting settings to specific nodes of a document map’s tree.

    To access the collection of levels, use the XRTableOfContents.Levels property.

    Unless levels have been added to a table of contents, a single default level is used to provide common settings to the elements of a document map for which no specific level has yet been assigned.

Managing Document Levels

To add a new level to the table of contents, do the following.

  1. Select the table of contents and click its smart tag.

    In the invoked actions list, click the ellipsis button for the Levels property.

    Table-of-Contents-Concepts02

  2. In the invoked collection editor, click Add.

    Table-of-Contents-Concepts03

  3. Specify the formatting settings for the created level and click OK to exit the dialog.

    Table-of-Contents-Concepts04

To customize the indentation settings of a document level, use its XRTableOfContentsLevel.Indent property. A zero value assigned to this property assumes the default indent settings.

See Add a Table of Contents for more information.

See Also