Skip to main content

Generate a Grid-Based Report

  • 2 minutes to read

You can generate a Grid-based Report with the same data, appearance, and layout as in the displayed GridControl. End users can customize a Report appearance.


You can generate a Grid-based Report only from the TableView.

Generate a Report at Runtime

The following example demonstrates how to initialize and open the Report Designer in code. To use this example in your project, add references to the DevExpress.Xpf.ReportDesigner.v22.1 and DevExpress.XtraReports.v22.1 assemblies.

using System.Windows;
using System.Collections.ObjectModel;
using DevExpress.XtraReports.UI;
using DevExpress.Xpf.Grid.Printing;
using DevExpress.XtraExport.Helpers;
using DevExpress.Xpf.Reports.UserDesigner;

namespace DXGridSample {
    public partial class MainWindow : Window {
        void BarButtonItem_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
        // Initializes and runs a Report Designer.
        public static void ShowDesigner(IGridViewFactory<ColumnWrapper, RowBaseWrapper> factory) {
            var report = new XtraReport();
            ReportGenerationExtensions<ColumnWrapper, RowBaseWrapper>.Generate(report, factory);
            ReportDesigner reportDesigner = new ReportDesigner();
            reportDesigner.Loaded += (s, e) => {
            reportDesigner.ShowWindow(factory as FrameworkElement);

Use Behaviors to Generate a Report

To initialize and open the Report Designer in XAML:

  1. Add reference to the DevExpress.Xpf.ReportDesigner.v22.1 assembly.
  2. Attach the GridReportManagerService to a TableView.
  3. Attach the ReportManagerBehavior to a ribbon or bar item.
  4. Bind the ReportManagerBehavior.Service property to GridReportManagerService.
    Height="350" Width="525">
        <dxb:ToolBarControl DockPanel.Dock="Top" >
            <dxb:BarSplitButtonItem Glyph="{dx:DXImage Image=Print_16x16.png}">
                    <dxrudex:ReportManagerBehavior Service="{Binding ElementName=reportManagerService}"/>
        <dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
                <dxg:TableView x:Name="view" ShowTotalSummary="True">
                        <dxrudex:GridReportManagerService x:Name="reportManagerService" />


  • If the GridControl works in the master-detail mode, only the master View is displayed within the Report Designer. End users can manually add detail rows to the Report.
  • The merged grid cells are exported as separate cells.
  • Custom grouping, sorting, and summaries are not applied to the Report.
See Also