Back to Devexpress

How to Use an Aggregate Function in Calculated Fields

xtrareports-12441-feature-guide-to-devexpress-reports-shape-report-data-use-calculated-fields-calculate-an-aggregate-function.md

latest1.4 KB
Original Source

How to Use an Aggregate Function in Calculated Fields

  • Feb 18, 2026
  • 2 minutes to read

This tutorial describes how to create a report that uses an aggregate function in a calculated field. In this example, the report displays products that are not discontinued and have a total unit value greater than $ 500.

Do the following to create a report:

  1. Launch the Report Wizard and create a new table report bound to the Products table of the sample Northwind database (the nwind.db file is included with the XtraReports installation):

  2. Group the report by the CategoryID field:

  3. The Report Wizard creates the following layout:

  4. Create calculated fields listed in the following table:

  5. Modify the report layout. Add labels and table cells bound to the previously created calculated fields as shown in the following image:

  6. Configure the format of the calcRevenuePercentage table cell to display percentages.

  7. Preview the report.

View Example: How to use aggregate functions in Calculated Field expressions