Skip to main content

Lesson 4 - Create a Report with a Document Map

  • 3 minutes to read

This tutorial illustrates how to group data in a report, and then implement a Document Map, which reflects the report’s structure and provides the navigation through its bookmarks. In addition, this tutorial will show you how to calculate common summary functions in your report.

In this tutorial, we will use the report created in the preceding lesson: Lesson 1 - Create a Static Report.

Perform the actions below to implement a Document Map for a report with groups in a Silverlight application.

Create a Report with Groups

  1. Bind the report to the Products table from the sample Northwind database. These steps are similar to those explained in Lesson 2 - Create a Data-Aware Report.
  2. To provide detail data to a report, drop the Products item from the Field List onto the Detail band.


  3. To group detail records in a report, switch to the Group and Sort Panel, click Add a Group and choose the CategoryID field from the drop-down list.


  4. Then, enable the Show Footer check box to add an associated Group Footer band to your report. If required, you can change the Sort Order as well.



    You can learn more about grouping at Group and Sort a Report’s Data.

  5. To reflect the group title in a report, drop the CategoryID item from the Field List onto the Group Header band.


Calculate a Summary for Groups (Optional)

You can calculate various summary functions in your report. The following steps illustrate this process.

  1. First, make a copy of the label residing in the Detail band and place it onto the Group Footer.


  2. Then, click the label’s smart tag, and in its actions list, click the ellipsis button for the XRLabel.Summary property.

    In the invoked Summary Editor, set Summary function to Count, enable the Ignore null values check box, and set the Summary Running to Group.



    You can learn more about available summary functions at Calculate Summaries.

Provide Bookmarks to the Report

The Document Map is auto-generated for a report, which has controls with defined bookmarks. The following steps demonstrate how you can do this.

  1. To provide a bookmark to the report, set its XtraReport.Bookmark property.


  2. For data-bound controls, you can bind their XRControl.Bookmark property to the required data field.

    So, let’s define a bookmark for the control that resides in the Group Header.


  3. Then, do the same for the label residing in the Detail band.


  4. For this label, you can also specify the XRControl.BookmarkParent property, which defines the nested hierarchy of the Document Map.


View the Result

The report with groups and a Document Map is now ready. Run the application and view the result.