IPivot.GroupElement

Fore Syntax

GroupElement(Dimension: IDimInstance; El: Integer);

Fore.NET Syntax

GroupElement(Dimension: Prognoz.Platform.Interop.Dimensions.IDimInstance; El: uinteger);

Parameters

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

El. Column index, which data must be grouped.

Description

The GroupElement method groups column data on drillthrough 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 name of the element in the Source Fields dimension.

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

Fore 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 example drillthrough is executed into relational data in the express report, data of the first column is grouped.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Analyzer: IEaxAnalyzer;
    Pivot: IPivot;
    DimInst: IDimInstance;
Begin
    // Get repository
    MB := Params.Metabase;
    // 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 System.Diagnostics.Debug.WriteLine("Unable to ungroup data");
    End If;
End Sub;

See also:

IPivot