Pivot: IPivot;
Pivot: Prognoz.Platform.Interop.Pivot.IPivot;
The Pivot property returns object to work with base to build data table.
Executing the example requires:
Regular report with the REPORT identifier containing analytical data area.
Express report with the EXPRESS identifier containing table.
Both reports are based on the same data source. Table formatting style is changed in express report.
Add links to the Dimensions, Express, Metabase, Pivot, Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
DataArea: IEaxDataArea;
RepGrid, EaxGrid: IEaxGrid;
PivSlice, Slice: IEaxDataAreaPivotSlice;
Pivot: IPivot;
CombSel: IDimSelection;
Express: IEaxAnalyzer;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get analytical data area of regular report
Report := MB.ItemById("REPORT").Edit As IPrxReport;
DataArea := Report.DataArea;
// Get table data view
RepGrid := DataArea.Views.Item(0) As IEaxGrid;
// Get base for building analytical data area slice
PivSlice := DataArea.Slices.Item(0) As IEaxDataAreaPivotSlice;
// Display the number of dimensions in the console window
Pivot := PivSlice.Pivot;
Debug.WriteLine("Number of dimensions = " + Pivot.DimCount.ToString);
// Display metric dimension selection in the console window
CombSel := PivSlice.CombinedIndicatorSelection;
Debug.WriteLine("Metric dimension selection elements = " + CombSel.ToString("", ", ", False));
// Get express report
Express := MB.ItemById("EXPRESS").Bind As IEaxAnalyzer;
// Get base to build slice
Slice := Express.DataArea.Slices.Item(0) As IEaxDataAreaPivotSlice;
// Get express report table
EaxGrid := Express.Grid;
// Apply slice and data view
PivSlice.Apply(Slice, EaxPivotSliceApplyOptions.Default_);
RepGrid.Apply(EaxGrid, EaxGridApplyOptions.Default_);
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, the console displays the number of dimensions in the slice, selection elements of metrics dimension. Express report settings are imported to regular report analytical data area.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IPrxReport;
DataArea: IEaxDataArea;
RepGrid, EaxGrid: EaxGrid;
PivSlice, Slice: IEaxDataAreaPivotSlice;
Pivot: IPivot;
CombSel: IDimSelection;
Express: IEaxAnalyzer;
Begin
// Get repository
MB := Params.Metabase;
// Get analytical data area of regular report
Report := MB.ItemById["REPORT"].Edit() As IPrxReport;
DataArea := Report.DataArea;
// Get table data view
RepGrid := DataArea.Views.Item[0] As EaxGrid;
// Get base for building analytical data area slice
PivSlice := DataArea.Slices.Item[0] As IEaxDataAreaPivotSlice;
// Display the number of dimensions in the console window
Pivot := PivSlice.Pivot;
System.Diagnostics.Debug.WriteLine("Number of dimensions = " + Pivot.DimCount.ToString());
// Display metric dimension selection in the console window
CombSel := PivSlice.CombinedIndicatorSelection;
System.Diagnostics.Debug.WriteLine("Metrics dimension selection elements = " + CombSel.ToString("", ", ", False));
// Get express report
Express := MB.ItemById["EXPRESS"].Bind() As IEaxAnalyzer;
// Get base to build slice
Slice := Express.DataArea.Slices.Item[0] As IEaxDataAreaPivotSlice;
// Get express report table
EaxGrid := Express.Grid;
// Apply slice and data view
PivSlice.Apply(Slice, EaxPivotSliceApplyOptions.epsaoDefault);
RepGrid.Apply(EaxGrid, EaxGridApplyOptions.egaoDefault);
(Report As IMetabaseObject).Save();
End Sub;
See also: