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

XRSummary.IgnoreNullValues Property

Specifies whether null values should be ignored when a summary is calculated.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll


public virtual bool IgnoreNullValues { get; set; }
Public Overridable Property IgnoreNullValues As Boolean

Property Value

Type Default Description


true to ignore null values; otherwise, false.


Use this property to specify whether null values should be ignored when a summary is calculated. If they are included they will be treated as zeros. For instance, for the SummaryFunc.Avg summary function and the following set of values:

1, null, 5

with the IgnoreNullValues = true the Average function's value will be 3, and

with the IgnoreNullValues = false the Average function's value will be 2.

To learn more, see Shaping Data using Legacy Data Bindings.


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