<< Click to Display Table of Contents >>

 

This document shows how to use a report control's Expression property to calculate a group summary, as shown in the image below:

xtrareports-summary

Follow the steps below to calculate a summary:

1.Create a report bound to a data source.

2.Use the Group and Sort Panel to group report data by the key data field and construct a layout like the following:

xtrareports-summary-report-layout

3.Right-click the report's Detail band and select Insert Band / Group Footer from the context menu.

xtrareports-summary-add-group-footer

4.Drop a Label control onto the Group Footer band.

xtrareports-summary-drop-label

5.Click the label's smart tag, then click the Summary field's ellipsis button to open the Summary Editor form.

summary-expressions-label-smart-tag

6.In the Summary Editor form, use the following options:

oSummary running - specifies summary calculation range (the entire report, current report group, or current document page).

oSummary function - specifies a summary function.

oArgument expression - specifies a data field or a complex expression.

summary-expressions-label-smart-tag

Tip

See the Expression Operators, Functions and Constants topic for a complete list of supported summary functions.

7.You can use the Format String property to format the summary value:

summary-format-string-label-smart-tag

Switch to Print Preview mode to see the result:

summary-report-group-result-preview