Calculate a Summary

Calculate a Summary

  • Aug 07, 2019
  • 2 min to read

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

NOTE

This topic assumes that the UserDesignerOptions.DataBindingMode property is set to DataBindingMode.Expressions (the default value) or DataBindingMode.ExpressionsAdvanced.

Refer to Calculate a Summary in the Shape Data (Legacy Data Bindings) section for the legacy approach.

See Data Binding Modes for information on available binding modes.

Follow the steps below to calculate a summary:

  1. Create a report bound to the sample Northwind database's Products table (the nwind.mdb file is included in the XtraReports installation).

  2. Use the Group and Sort Panel to group report data by the CategoryName 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 an XRLabel 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:

    • Summary running - specifies summary calculation range (the entire report, current report group, or current document page).
    • Summary function - specifies a summary function.
    • Argument expression - specifies a data field or a complex expression.

    summary-expressions-label-smart-tag

    TIP

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

  7. You can use the FormatString 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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值