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

ProcessDuplicatesTarget Enum

Lists control characteristics whose duplicate values are processed.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.1.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.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

Note

Use the XRControl.ProcessDuplicatesMode property to specify how to treat controls with duplicate characteristics.

The following code illustrates two cases:

  • Labels bound to the Category Name column with duplicate Category Name column values.
  • Labels bound to the Category Name 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 different groups.

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

The results are shown below:

Note

The complete sample project is available in the following DevExpress Examples repository on GitHub: How to process duplicate values in a report.

Tip

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 different value 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