Back to Devexpress

XRSummary.Running Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrsummary.md

latest4.6 KB
Original Source

XRSummary.Running Property

Gets or sets a value that specifies a report area in which arithmetic function is calculated.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(SummaryRunning.None)]
public virtual SummaryRunning Running { get; set; }
vb
<DefaultValue(SummaryRunning.None)>
Public Overridable Property Running As SummaryRunning

Property Value

TypeDefaultDescription
SummaryRunningNone

A SummaryRunning enumeration value.

|

Available values:

NameDescription
None

The function is not calculated.

| | Group |

The function is calculated for every group. If the label displays ?, the value cannot be evaluated under these conditions.

| | Report |

The function is calculated for the entire report.

| | Page |

The function is calculated for the current page where the label is displayed.

|

Remarks

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

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

  • GroupHeaderBand, GroupFooterBand, or DetailBand - the label displays the function value calculated for the current group;
  • any other band - the label displays ?. This means that value cannot be evaluated under these conditions.

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.

csharp
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;
}
vb
Imports DevExpress.XtraReports.UI
' ...
Public Sub SetFunction(ByVal label As XRLabel)
    ' Create an XRSummary object. 
    Dim summary As 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
End Sub

See Also

XRSummary Class

XRSummary Members

DevExpress.XtraReports.UI Namespace