Skip to main content

ProcessDuplicatesTarget Enum

Lists control characteristics whose duplicate values are processed.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public enum ProcessDuplicatesTarget

Members

Name Description
Value

The control’s field data values are considered when the report processes duplicate values.

Tag

The control’s Tag property values are considered when the report processes duplicate values.

Remarks

The following code illustrates two cases:

  • Controls bound to the same column with duplicate column values.
  • Controls bound to the same column with duplicate values stored in the Tag property.

Consider the second case in greater detail. Different report groups can have the same field values. If you wish to merge field values within a group, and not across groups, set the control’s ProcessDuplicatesTarget property to ProcessDuplicatesTarget.Tag and use an expression to calculate the control’s Tag property value. The expression should combine the current group field and the control’s data field, so that the Tag value is different for each group.

Use the control’s ProcessDuplicatesMode property to specify how to treat controls with duplicate characteristics. For more information specific to controls, refer to the following topics:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace ProcessDuplicatesTarget
{
    public partial class ProductReport : DevExpress.XtraReports.UI.XtraReport
        {
            public ProductReport()
            {
                InitializeComponent();
            }
            // Display duplicate values.
            public void NoMerge()
            {
                this.ShowPreviewDialog();
            }
            // Merge duplicate values of the XRControl.Tag property.
            public void MergeByTag()
            {
                ExpressionBinding expressionBinding = new ExpressionBinding("BeforePrint", "Tag", "ToStr([SupplierID]) + '_' + ToStr([CategoryID])");
                this.xrTableCell2.ExpressionBindings.Add(expressionBinding);
                this.xrTableCell2.ProcessDuplicatesMode = ProcessDuplicatesMode.Merge;
                this.xrTableCell2.ProcessDuplicatesTarget = DevExpress.XtraReports.UI.ProcessDuplicatesTarget.Tag;
                this.ShowPreviewDialog();
            }
            // Merge duplicate values of a report control's data.
            public void MergeByValue()
            {
                ExpressionBinding expressionBinding = new ExpressionBinding("BeforePrint", "Text", "[CategoryName]");
                this.xrTableCell2.ExpressionBindings.Add(expressionBinding);
                this.xrTableCell2.ProcessDuplicatesMode = ProcessDuplicatesMode.Merge;
                this.xrTableCell2.ProcessDuplicatesTarget = DevExpress.XtraReports.UI.ProcessDuplicatesTarget.Value;
                this.ShowPreviewDialog();
            }
        }
}

The results are shown below:

View Example: Reporting for WinForms - How to Vertically Merge Cells With Duplicate Values

If different report groups have the same field values and you wish to merge field values within individual groups, create an expression that has the same value for controls within a group and non similar values for controls in different groups. The expression should include a current group field and a field whose values you wish to merge. Set the ProcessDuplicatesTarget property to Tag and assign the created expression to the control’s Tag property.

See Also