Back to Devexpress

Calculate a Summary

xtrareports-119436-feature-guide-to-devexpress-reports-shape-report-data-calculate-summaries-calculate-a-summary.md

latest2.6 KB
Original Source

Calculate a Summary

  • Feb 18, 2026
  • 3 minutes to read

This document shows how to use summary functions to calculate a group summary. For more information on summary functions, review the following help topic: Summaries Overview.

The following images show a sample report with a summary:

Follow the steps below to create a sample report with a summary.

Bind a Report to Data

  1. Add a new blank report to the project. Review the following help topic for details: Create a Report in Visual Studio.

  2. Click Add Report Data Source in the report’s smart tag to invoke the Data Source Wizard , as illustrated in the following image:

  3. Create a data source and bind it to the SalesByCategory view from the `sample Northwind database.

Group Data by Category

  1. Use the Group and Sort panel to create a Group Header band associated with the CategoryName field. If the panel is hidden, click Group and Sort in the XtraReports menu:

  2. Select the Show Footer checkbox in the Group and Sort panel to add the Group Footer band:

Add Report Controls to Display Data

  1. Click Field List in the Visual Studio XtraReports menu to invoke the Field List panel. Drop fields from the Field List panel to the report bands as follows:

  2. Drop the XRLabel control onto the Group Footer band:

Add a Summary

  1. Click the label’s smart tag. Then click the ellipsis next to the Summary editor to invoke the Summary Editor dialog.

  2. The Summary Editor dialog allows you to specify the following options:

  3. The Summary Editor assigns an expression to the XRLabel’s Expression editor:

  4. You can click the ellipsis next to the Expression editor to invoke the Expression Editor dialog:

  5. Switch to the Preview tab to see the resulting report.