IPivot.MergedNamingMode

Syntax

MergedNamingMode: PivotMergedNamingMode;

Description

The MergedNamingMode property determines a method for merging elements of different dimensions.

Comments

To display merging in express report, set arrangement by all dimensions. To do this:

  1. Go to the Designer ribbon.

  2. Click the Arrangement button.

  3. Select the All Dimensions checkbox.

Merging is executed for names of elements of the first dimension by rows/columns and the name of the dimension element specified in the IPivotDimensionSettingsEx.MergedElement property. The IPivotDimensionSettingsEx.MergedElement setting can be determined for any dimension except for the first one located by rows or columns.

Example

To execute the example, place on the form the Button named Button1, the UiErAnalyzer component named UiErAnalyzer1, and the TabSheetBox component named TabSheetBox1. Specify UiErAnalyzer1 as a data source for TabSheetBox1 in the Source property. The express report specified in the Object property is a data source for UiErAnalyzer1. Set the Active property to True for UiErAnalyzer1.

Add links to the Dimensions, Express, Pivot, and Tab system assemblies.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Eax: IEaxAnalyzer;
    Pivot: IPivot;
    Key: Integer;
    DimSettings: IPivotDimensionSettingsEx;
Begin
    Eax := UiErAnalyzer1.ErAnalyzer;
    Pivot := Eax.Pivot;
    // Set dimension element merge method and separator that will be used in name
    Pivot.MergedNamingMode := PivotMergedNamingMode.UpperElement Or PivotMergedNamingMode.LowerElement;
    Pivot.MergedNamingSeparator := " | ";
    // Get key of the second dimension located in sidehead
    Key := Pivot.LeftHeader.Dim(1).Key;
    // Set up dimensions
    DimSettings := Pivot.Dimensions.FindByKey(Key).Settings;
    DimSettings.MergedElement := 0;
    Debug.WriteLine("Number of selection elements: " + DimSettings.MergedSelection.SelectedCount.ToString);
    If DimSettings.MergeTopDown = True Then
        Debug.WriteLine("Elements are merged with tucking");
    Else
        Debug.WriteLine("Elements are merged without tucking");
    End If;
End Sub Button1OnClick;

Clicking the button in the express report sidehead enables merging of upper level element names with the first element of the second dimension. The console displays the number of merged selection elements and whether tucking is used. For example:

Number of selection elements: 2

Elements are merged with tucking

Original table sidehead appearance:

Table sidehead appearance after example execution:

See also:

IPivot