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

XRLabel.Summary Property

Gets the value that was calculated for the data source field bound to the XRControl.Text property of the given label.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[Favorite(true)]
[Browsable(true)]
[SRCategory(ReportStringId.CatData)]
[XtraSerializableProperty(XtraSerializationVisibility.Content)]
public XRSummary Summary { get; set; }
<Favorite(True)>
<Browsable(True)>
<SRCategory(ReportStringId.CatData)>
<XtraSerializableProperty(XtraSerializationVisibility.Content)>
Public Property Summary As XRSummary

Property Value

Type Description
XRSummary

An XRSummary object that represents the calculated numerical value.

Remarks

The calculated numerical value corresponds to one of the summary functions listed in the Expression Constants, Operators, and Functions topic. The report area, for which a function is calculated, is determined by the SummaryRunning enumeration. A format for the value returned by this property is set by the XRLabel.TextFormatString property.

To learn more about calculating summaries in XtraReports see the Shaping Data using Legacy Data Bindings and Calculating Custom Summaries via Scripts topics.

Note

If a label calculates a summary value, its XRLabel.CanShrink and XRLabel.CanGrow property values are ignored.

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;
}
See Also