[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
   [Collapse]Getting Started
     Lesson 1 - Create Your First Report
     Lesson 2 - Create a Grouped Report with a Document Map
     Lesson 3 - Use Your Grid Control's Layout to Create a Report
   [Expand]Fundamental Concepts
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Lesson 2 - Create a Grouped Report with a Document Map

This tutorial will guide you through the process of creating a grouped report using the DXPrinting library for WPF. It will begin with the report created in the previous lesson: Lesson 1 - Create Your First Report.

In this tutorial, you will learn how to group document data using a printing link type for processing collection data sources. You will also learn how to define distinct data templates for document groups in XAML.

To create groups in a report, do the following.

Expanded Modify Data Templates

  1. In your reporting application, open the MainForm.xaml file, and declare a GroupInfo data template. This template will display category names using the TextEdit control, and arrange detail table headers in table rows.
  2. For complex reports, it makes sense to provide a document map that makes the document easier to navigate in print preview. To make the document map reflect the hierarchical structure of the report, specify a bookmark for the category name, and make it a parent of the product name bookmark.

The following code demonstrates the XAML data templates of a grouped report with a document map.

Expanded Define the Data Source

Define a method that will implement the System.ComponentModel.ICollectionView interface for the data source created in the previous lesson. This method should apply grouping to the view source before returning the view.

Expanded Create a Printing Link

DXPrinting provides a special link type to create grouped reports from ICollectionView data sources: CollectionViewLink.

The following code illustrates the implementation of this link.

Expanded View the Result

Your report is now ready to be generated. It reflects the hierarchy of your data via grouping and the document map. Run the application and view the results.

Expanded See Also

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