Show contents 

Express > Express Assembly Interfaces > IEaxGrid > IEaxGrid.DrillCell

IEaxGrid.DrillCell

Syntax

DrillCell(Row: Integer; Column: Integer; DrillType: EaxDrillType);

Parameters

Row. Index of the row with cell.

Column. Index of the column with cell.

DrillType. Drilldown method that should be applied to the cell.

Description

The DrillCell method drills down data for the selected table cell.

Comments

The method can be used if the IsCellDrillable property returns True for the specified cell. After executing the DrillCellmethod the selection in heading/sidehead dimensions, by which drilldown is available, is changed. Data is loaded to the table according to the new selection. The same table cells before and after drilldown have different binding to data source: data source may change during drilldown, cells will correspond to a different dimension selection. For details about binding of table cell to data source use the DrillCellResult method.

Example

Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier. The express report is based on the data source, which heading contains a calendar dimension with several element levels.

Add links to the Express, Metabase, Tab system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Expr: IEaxAnalyzer;
    Grid: IEaxGrid;
    DataRange: ITabRange;
    DrillResult: IEaxDrillCellResult;
    Row, Column: Integer;
Begin
    Mb := MetabaseClass.Active;
    // Open express report
    Expr := Mb.ItemById("EXPRESS_REPORT").Open(NullAs IEaxAnalyzer;
    Grid := Expr.Grid;
    // Range of data cells
    DataRange := Grid.SpecificRange(EaxRangeType.Internal);
    // Coordinates of the first cell with data
    Row := DataRange.Top;
    Column := DataRange.Left;
    // Check data can be drilled down
    If Grid.IsCellDrillable(Row, Column, EaxDrillType.Down) Then
        // Information about cell binding to data source before data drilldown
        Debug.WriteLine("Before drilldown:");
        DrillResult := Grid.DrillCellResult(Row, Column);
        Debug.WriteLine("Cell (" + Row.ToString + ", " + Column.ToString + ") corresponds to selection:");
        ShowCellSelection(DrillResult.Selection);
        // Data drilldown
        Grid.DrillCell(Row, Column, EaxDrillType.Down);
        // Information about cell binding to data source after data drilldown
        Debug.WriteLine("After drilldown:");
        DrillResult := Grid.DrillCellResult(Row, Column);
        Debug.WriteLine("Cell (" + Row.ToString + ", " + Column.ToString + ") corresponds to selection:");
        ShowCellSelection(DrillResult.Selection);
    End If;
End Sub UserProc;

Sub ShowCellSelection(DimSS: IDimSelectionSet);
Var
    DimS: IDimSelection;
Begin
    Debug.Indent;
    For Each DimS In DimSS Do
        Debug.WriteLine(DimS.Dimension.Name + ": " + DimS.Element(0).ToString);
    End For;
    Debug.Unindent;
End Sub ShowCellSelection;

After executing the example the express report opens, and coordinates of the first cell with data are obtained. It is checked if data can be drilled down in this cell. If data can be drilled down, it will be executed. The development environment console displays information about correspondence between the cell and the matrix with source data before and after drilldown.

See also:

IEaxGrid | IEaxGrid.DrillRange