IPivotTableHeader.ElementDim

Fore Syntax

ElementDim(SlotNumber: Integer; ElementNumber: Integer): IDimInstance;

Fore.NET Syntax

ElementDim(SlotNumber: integer; ElementNumber: integer): Prognoz.Platform.Interop.Dimensions.IDimInstance;

Parameters

SlotNumber. Slot index in the table header.

ElementNumber. Element index in the table header.

Description

The ElementDim property returns data about dimension that is present in the table header.

Fore Example

Executing the example requires that the repository contains an express report with a data table with the EXPRESS_SLOTS identifier.

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

Sub UserProc;
Var
    MB: IMetabase;
    Report: IEaxAnalyzer;
    Pivot: IPivot;
    TableHeader: IPivotTableHeader;
    DimKey, Element: Integer;
    DimInst: IDimInstance;
Begin
    
// Get the current repository
    MB := MetabaseClass.Active;
    
// Get express report
    Report := MB.ItemById("EXP_SLOTS").Bind As IEaxAnalyzer;
    
// Get object, based on which data table is built
    Pivot := Report.Pivot;
    
// Get properties of table column headers
    TableHeader := Pivot.ObtainTable.TopHeader;
    // Get dimension name and key in the second cell of the first column header
    DimInst := TableHeader.ElementDim(01);
    DimKey := TableHeader.ElementDimKey(
01);
    Debug.WriteLine(
"Name: " + DimInst.Name + ", Key: " + DimKey.ToString);
    
// Get dimension element index
    Element := TableHeader.DimensionElement(DimKey, 1);
    Debug.WriteLine(
"Index: " + Element.ToString);
End Sub UserProc;

After executing the example the console window displays name, key, and index of the dimension, which is present in the second cell of the first column header:

Name: Data types, Key: 10200

Index: 0

Fore.NET Example

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

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


Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Report: IEaxAnalyzer;
    Pivot: IPivot;
    TableHeader: IPivotTableHeader;
    DimKey, Element: Uinteger;
    DimInst: IDimInstance;
Begin
    
// Get the current repository
    MB := Params.Metabase;
    
// Get express report
    Report := MB.ItemById["EXP_SLOTS"].Bind() As IEaxAnalyzer;
    
// Get object, based on which data table is built
    Pivot := Report.Pivot;
    
// Get properties of table column headers
    TableHeader := Pivot.ObtainTable().TopHeader;
    // Get dimension name and key in the second cell of the first column header
    DimInst := TableHeader.ElementDim[01];
    DimKey := TableHeader.ElementDimKey[
01];
    System.Diagnostics.Debug.WriteLine(
"Name: " + DimInst.Name + ", Key: " + DimKey.ToString());
    
// Get dimension element index
    Element := TableHeader.DimensionElement[DimKey, 1];
    System.Diagnostics.Debug.WriteLine(
"Index: " + Element);
End Sub;

See also:

IPivotTableHeader