xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xtrareport-a69e083e.md
Gets or sets the text shown as a root bookmark in a Document Map.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[Browsable(true)]
[SRCategory(ReportStringId.CatNavigation)]
public override string Bookmark { get; set; }
<Browsable(True)>
<SRCategory(ReportStringId.CatNavigation)>
Public Overrides Property Bookmark As String
| Type | Description |
|---|---|
| String |
A String representing a root bookmark’s text.
|
When you specify the Bookmark property for at least one of the report controls, a Document Map for the report document is created. If the value of the report’s Bookmark property is not empty, it is used as the name of the document’s root bookmark. Otherwise, the value of the report’s DisplayName property is used as a root bookmark. If the DisplayName property is not specified, the value of the report’s Name property is used as a root bookmark.
This example demonstrates how to create a document map with bookmarks for each page in a report.
To implement a document map in your report, do the following.
To create a table report, start with a report that is bound to the “Products” table of the sample Northwind database. To learn more about binding a report to a data source, see Providing Data to Reports.
Set the report’s XtraReport.Bookmark property to “Table of Contents”.
To create the report’s main content, drop the ProductName field from the Field List onto the report’s Detail band.
Insert a ReportHeaderBand. To do this, right-click anywhere in the report designer, and in the invoked context menu point to Insert Band , and then click ReportHeader.
Insert a PageHeaderBand. To do this, right-click anywhere in the report designer, and in the context menu, point to Insert Band , and then click PageHeader.
using System;
using DevExpress.XtraReports.UI;
// ...
private void xrLabel3_PrintOnPage(object sender, PrintOnPageEventArgs e) {
// Obtain the current page number.
string s = (e.PageIndex + 1).ToString();
// Set the label's text and bookmark (this label is located on the PageHeader
// band, so it will show a bookmark for every report page
((XRLabel)sender).Bookmark += s;
((XRLabel)sender).Text += s;
}
Imports System
Imports DevExpress.XtraReports.UI
' ...
Private Sub xrLabel3_PrintOnPage(ByVal sender As Object, _
ByVal e As PrintOnPageEventArgs) Handles xrLabel2.PrintOnPage
' Obtain the current page number.
Dim s As String = (e.PageIndex + 1).ToString()
' Set the label's text and bookmark (this label is located on the PageHeader
' band, so it will show a bookmark for every report page
CType(sender, XRLabel).Bookmark += s
CType(sender, XRLabel).Text += s
End Sub
See Also