Skip to main content
A newer version of this page is available. .

XRSummary.TreatStringsAsNumerics Property

Specifies whether or not a summary function should treat strings as numeric values.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(true)]
public virtual bool TreatStringsAsNumerics { get; set; }

Property Value

Type Default Description
Boolean **true**

true to make the summary function treat strings as numeric values; otherwise false.

Remarks

For example, you can disable this option to maintain the original string values when calculating MIN/MAX summary functions.

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