IEaxGrid.DrillTo

Syntax

DrillTo(Range: ITabRange; DimKey: Integer; LevelKey: Integer): Boolean;

Parameters

Range. Table cell range to be drilled down.

DimKey. Dimension key

LevelKey. Dimension level, to which the system goes to work with data.

Description

The DrillTo method drills down data for the selected table cell range with going to the specified dimension level.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier. The report contains a data source, based on which an analytical data area is built. The column header uses the dimension containing at least two element levels, and selection is set.

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

Sub UserProc;
Var
    Mb: IMetabase;
    Report: IPrxReport;
    Grid: IEaxGrid;
    DataRange, DrillRange: ITabRange;
    Dim: IDimInstance;
Begin
    Mb := MetabaseClass.Active;
    // Open report
    Report := Mb.ItemById("REPORT").Open(NullAs IPrxReport;
    Grid := Report.DataArea.Views.Item(0As IEaxGrid;
    // Header cell range
    DrillRange := Grid.SpecificRange(EaxRangeType.HeaderDrillDown);
    Debug.WriteLine("Range for drilldown: " + DrillRange.Address);
    // Check data can be drilled down
    If Grid.IsRangeDrillable(DrillRange, EaxDrillType.To_) Then
        DataRange := Grid.SpecificRange(EaxRangeType.Internal);
        Debug.WriteLine("Data range before drilldown: " + DataRange.Address);
        Dim := (Grid.Slice As IEaxDataAreaPivotSlice).Pivot.TopHeader.Dim(0);
        // Drilldown to the specified dimension level
        Grid.DrillTo(DrillRange, Dim.Key, Dim.Levels.Item(1).LevelKey);
        DataRange := Grid.SpecificRange(EaxRangeType.Internal);
        Debug.WriteLine("Data range after drilldown: " + DataRange.Address);
    End If;
End Sub UserProc;

After executing the example the report is opened. The cell range, in which drilldown can be executed, is obtained. Drilldown is executed to the second dimension level. Data cell range addresses before and after drilldown are displayed in the development environment console.

See also:

IEaxGrid