Skip to main content

XRSummary.Running Property

Gets or sets a value specifying a report area, for which the arithmetic function is calculated.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultValue(SummaryRunning.None)]
public virtual SummaryRunning Running { get; set; }

Property Value

Type Default Description
SummaryRunning None

A SummaryRunning enumeration value.

Remarks

The set of possible values for this property is available at SummaryRunning, and the arithmetic function to be calculated is set by the XRSummary.Func property.

If this property is set to the SummaryRunning.Report, a label always displays the function value calculated for the entire report.

If this property is set to the SummaryRunning.Page, a label always displays the function value calculated for the current page where the label is printed.

If this property is set to the SummaryRunning.Group, the displayed result depends on the band where the label is positioned:

Example

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 that contains 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 "treat strings as numerics" option.
    summary.TreatStringsAsNumerics = 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;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Running property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also