TableNoData: IPivotTable;
The TableNoData property returns the table without recalculating it.
The property enables the user to optimize data loading time when accessing table. Unlike the IPivot.ObtainTable method, the property does not recalculate a table that is already calculated and stored in memory, thus, data loads faster.
If the data table is changed after calculation, the property is set to Null.
Executing the example requires that the repository contains a regular report with the REGULAR_REPORT identifier. The report must contain a data table built on a cube.
Add links to the Express, Metabase, Pivot, Report system assemblies.
Public Sub Check_TableNoData(Is_Edit: Boolean);
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Report: IPrxReport;
Pivot: IPivot;
PivotTable: IPivotTable;
DataArea: IEaxDataArea;
Slice: IEaxDataAreaSlices;
SliceItem: IEaxDataAreaSlice;
RowCount: Integer;
ColumnCount: Integer;
Begin
// Get repository
Mb := MetabaseClass.Active;
// Get regular report
Obj := Mb.ItemById("REGULAR_REPORT");
// Open report for edit, if the True value is passed to the procedure
If Is_Edit = True Then
Report := Obj.Edit As IPrxReport;
Else
// Open report for view
Report := Obj.Open(Null) As IPrxReport;
End If;
// Get data area of regular report
DataArea := Report.DataArea;
// Get collection of data area slices
Slice := DataArea.Slices;
// Select the first slice of data area
SliceItem := Slice.Item(0);
// Create a basis to get tables from data area slice
Pivot := (SliceItem As IEaxDataAreaPivotSlice).Pivot;
// Get table of data area slice
PivotTable := Pivot.TableNoData;
// Display corresponding message in the console if table is not retrieved
If PivotTable = Null Then
Debug.WriteLine("Data table is not retrieved !");
Else
// Display number of table rows in the console
RowCount := PivotTable.RowCount;
Debug.WriteLine("Number of table rows:" + RowCount.ToString);
// Display number of table columns in the console
ColumnCount := PivotTable.ColumnCount;
Debug.WriteLine("Number of table columns:" + ColumnCount.ToString);
End If;
Debug.WriteLine("===============================================");
End Sub Check_TableNoData;
Public Sub UserProc;
Begin
// Display message in the console that retrieved table cannot be edited
Debug.WriteLine("GET TABLE WHICH CANNOT BE EDITED");
// Call the Check_TableNoData procedure with the False attribute
Check_TableNoData(False);
// Display message in the console that retrieved table can be edited
Debug.WriteLine("GET TABLE WHICH CAN BE EDITED");
// Call the Check_TableNoData procedure with the True attribute
Check_TableNoData(True);
End Sub UserProc;
On executing the example, an attempt to open a regular report and get data table from it is made twice: a table which cannot be edited and a table which can be edited. If the table is retrieved successfully, the console displays information about the number of table rows and columns. If the table is not retrieved, the console displays the corresponding message.
The example of result output:
GET TABLE WHICH CANNOT BE EDITED
Number of table rows: 10
Number of table columns: 4
===============================================
GET TABLE WHICH CAN BE EDITED
Could not get data table!
===============================================
See also: