Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Collapse]Reporting
 [Expand]Product Information
 [Expand]Getting Started with DevExpress Reporting
 [Expand]Creating Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Expand]Providing Data to Reports
  [Expand]Using Report Controls
  [Expand]Shaping Report Data
   Laying out Dynamic Report Contents
  [Expand]Customizing Appearance
  [Collapse]Adding Navigation
    Adding Page Numbers
    Adding Cross-References and Hyperlinks
    Adding Bookmarks and a Document Map
    Adding a Table of Contents
  [Expand]Providing Interactivity
  [Expand]Adding Customary Information
  [Expand]Merging Reports
  [Expand]Using Expressions
  [Expand]Storing and Distributing Reports
  [Expand]Reporting API
 [Expand]Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

Adding Bookmarks and a Document Map

This document describes how to use bookmarks for mapping the report elements' hierarchy to the Document Map that is displayed in a Print Preview, and speeds up the navigation through complex reports.

Tip

Report bookmarks are required to construct a table of contents.

This topic consists of the following sections:

Expanded Adding Bookmarks to a Report

Do the following to provide bookmarks to your report:

  1. Start with a report bound to the CategoryProducts view of the sample Northwind database (the nwind.mdb file included in the XtraReports installation). See Providing Data to Reports to learn more about data binding.

  2. Group the report by the CategoryName field as demonstrated below.

  3. Select the label placed in the Group Header band and switch to the Properties window's Expressions tab. Click the XRControl.Bookmark property's ellipsis button, and in the invoked Expression Editor, select the CategoryName data field.

    In the legacy binding mode (if the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Bindings), you can specify this property in the Properties window's DataBindings category.

  4. In the same way, select the label in the Detail band and bind its XRControl.Bookmark property to the ProductName data field.

    Most of the reporting controls (for example, XRTable, XRTableCell, XRCheckBox, etc.) supports the Bookmark property.

  5. Set the same label's XRControl.BookmarkParent property to the label in the group band. This arranges bookmarks into a parent-child structure reflecting the report elements' hierarchy in the Document Map.

    Note

    Avoid cyclic bookmarks that occur when you assign two bookmarks as parents to each other. In this scenario, an exception raises when you attempt to create the report document.

  6. Select the report itself and assign text to its XtraReport.Bookmark property to determine the root node's caption in the Document Map.

    The root bookmark displays the report name if you do not specify this property.

Note

Duplicated bookmarks are suppressed to prevent adding multiple bookmarks with the same name to a final document. You can disable the XtraReport.BookmarkDuplicateSuppress property to allow duplicated bookmarks.

The following image illustrates the resulting report with the hierarchical Document Map. Clicking any bookmark navigates the Print Preview to the document section containing the associated element.

Expanded Adding Bookmarks for Every Page

Do the following to create a document map with bookmarks for each report page:

  1. Start with a report bound to the Products table of the sample Northwind database (the nwind.mdb file included in the XtraReports installation). See Providing Data to Reports to learn more about data binding.

  2. Set the report's XtraReport.Bookmark property to "Table of Contents".

  3. Drop the ProductName field from the Field List onto the report's Detail band.

  4. Insert a Report Header band by right-clicking anywhere in the report and selecting Insert Band | ReportHeader.

  5. Drop an XRLabel control onto the Report Header and set its XRControl.Bookmark and XRControl.Text properties to "Home".

  6. Add a Page Header band by right-clicking anywhere in the report and choosing Insert Band | PageHeader.

  7. Drop an XRLabel control onto this band and set the XRControl.Bookmark and XRControl.Text properties to "Page". Assign the XRControl.BookmarkParent property to the previously created Home label.

  8. Handle the Page label's XRControl.PrintOnPage event as follows:

The image below demonstrates the result.


When exporting a report to the PDF format, the Document Map is exported as well.

Is this topic helpful?​​​​​​​