ItemByElement(Element: Integer): IPivotTable;
Element. Dimension element index.
The ItemByElement property returns variant of data table by element index.
To get table variant by its index, use the IPivotTables.Item property.
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.
See also: