IPivotTables.ItemByElement

Fore Syntax

ItemByElement(Element: Integer): IPivotTable;

Fore.NET Syntax

ItemByElement[Element: uinteger]: Prognoz.Platform.Interop.Pivot.IPivotTable;

Parameters

Element. Dimension element index.

Description

The ItemByElement property returns variant of data table by element index.

Comments

To get table variant by its index, use the IPivotTables.Item property.

Fore Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. The report contains a table.

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

Sub USerProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    PivTable: IPivotTable;
    Elements: IDimElements;
    Element: integer;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get express report
    Express := MB.ItemById("EXPRESS").Bind As IEaxAnalyzer;
    // Get display settings of report data table
    Pivot := Express.Pivot;
    // Get table element
    Elements := Pivot.DimItem(0).Elements;
    Element := Elements.Elements.Element(0);
    // Get table by element and output the number of its rows and columns
    PivTable := Pivot.ObtainTables.ItemByElement(Element);
    Debug.WriteLine("Number of rows = " + PivTable.RowCount.ToString);
    Debug.WriteLine("Number of columns = " + PivTable.ColumnCount.ToString);
End Sub USerProc;

After executing the example the console window displays the number of rows and columns of the obtained table variant.

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;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    PivTable: IPivotTable;
    Elements: IDimElements;
    Element: uinteger;
Begin
    // Get repository
    MB := Params.Metabase;
    // Get express report
    Express := MB.ItemById["EXPRESS_COMMON"].Bind() As IEaxAnalyzer;
    // Get display settings of report data table
    Pivot := Express.Pivot;
    // Get table element
    Elements := Pivot.DimItem[0].Elements;
    Element := Elements.Elements.Element[0];
    // Get table by element and output the number of its rows and columns
    PivTable := Pivot.ObtainTables().ItemByElement[Element];
    System.Diagnostics.Debug.WriteLine("Number of rows = " + PivTable.RowCount.ToString());
    System.Diagnostics.Debug.WriteLine("Number of columns = " + PivTable.ColumnCount.ToString());
End Sub;

See also:

IPivotTables