The requested page is not available for the requested platform. You are viewing the content for Default platform.

XRSummary Class

Provides methods that calculate arithmetic functions for the values in the data source field bound to the XRControl.Text property of the XRLabel control and its descendants.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[TypeConverter(typeof(XRSummaryConverter))]
public class XRSummary :
    IXRSerializable,
    IDisposable,
    IXRControlContainer
<TypeConverter(GetType(XRSummaryConverter))>
Public Class XRSummary
    Implements IXRSerializable,
               IDisposable,
               IXRControlContainer

Remarks

The set of available functions is specified by the SummaryFunc enumeration. The report area for which a function is calculated is determined by the SummaryRunning enumeration.

To learn more about calculating summaries in reports, see the Shaping Data using Legacy Data Bindings topic.

Examples

The following example demonstrates how to set summary options for a label at runtime. The method below creates an XRSummary object, sets its properties, and sets the XRLabel.Summary property. This example assumes that there is an already existing XRLabel object, passed as a parameter and bound to a dataset field containing a numerical value.

using DevExpress.XtraReports.UI;
// ...

public void SetFunction(XRLabel label) {
    // Create an XRSummary object.
    XRSummary summary = new XRSummary();

    // Set a function which should be calculated.
    summary.Func = SummaryFunc.Avg;

    // Set a range for which the function should be calculated.
    summary.Running = SummaryRunning.Group;

    // Set the "ingore null values" option.
    summary.IgnoreNullValues = true;

    // Set the output string format.
    summary.FormatString = "{0:c2}";

    // Make the label calculate the specified function for the
    // value specified by its DataBindings.Text property.
    label.Summary = summary;
}

Inheritance

Object
XRSummary

Implements

DevExpress.XtraReports.Serialization.IXRSerializable
DevExpress.XtraReports.Design.IXRControlContainer
See Also