IPivot.GroupElement

Syntax

GroupElement(Dimension: IDimInstance; El: Integer);

Parameters

Dimension. The Source Fields additional dimension obtained after drill down into relational data.

El. Column index, which data must be grouped.

Description

The GroupElement method groups column data on drill down into relational data.

Comments

To group data elements, the IPivot.DrillThrough property must be set to True.

After grouping a new dimension is created in the express report which name corresponds to the element name in the Source Fields dimension.

To cancel data grouping after column grouping, use IPivot.UngroupElement.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. Data source of the report is a cube with configured server aggregation.

Add links to the Dimensions, Express, Metabase, Pivot system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Analyzer: IEaxAnalyzer;
    Pivot: IPivot;
    DimInst: IDimInstance;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get express report
    Analyzer := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get express report data table
    Pivot := Analyzer.Pivot;
    // Drill through data into relational table
    Pivot.DrillThrough := True;
    // Get data of the "Source Fields" new dimension
    DimInst := Pivot.Selection.FindById("SRC_AND_FLD").Dimension;
    // Group the first column that corresponds to the first selection element of the "Source Fields" dimension
    Pivot.GroupElement(DimInst, 0);
    // Save changes
    (Analyzer As IMetabaseObject).Save;
    
    { To ungroup column }
    If Pivot.CanUngroupElement(Pivot.DimItem(6))
        Then
            Pivot.UngroupElement(DimInst);
        Else Debug.WriteLine("Unable to ungroup data");
    End If;
    // Save changes
    (Analyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the express report example drillthrough is executed into relational data in the express report, data of the first column is grouped.

See also:

IPivot