LevelTotals: IPivotTotals;
LevelTotals: Prognoz.Platform.Interop.Pivot.IPivotTotals;
The LevelTotals property returns the object that is used to work with totals by level.
Totals are calculated by level by all elements of displayed levels.
To get an object that is used to work with totals by hierarchy, use IPivotDimensionLevelPropertiesCommon.HierarchyTotals.
Executing the example requires that the repository contains an express report with the EXPRESS identifier. Report data source is a cube that contains the dimensions consisting of several levels.
Add links to the Express, Matrix, Metabase, and Pivot system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Pivot: IPivot;
LHeader: IPivotHeader;
LevTotals: IPivotTotals;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get display settings of report data table
Pivot := Express.Pivot;
// Get collection of dimensions located by rows
LHeader := Pivot.LeftHeader;
// Get object used to work with totals by hierarchy
LevTotals := LHeader.LevelTotals;
// Enable displaying of totals
If Not LevTotals.HasTotals Then
LevTotals.Totals := Tristate.OnOption;
End If;
// Set aggregation method - sum
LevTotals.Method := BasicAggregatorOperation.Sum;
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the table sidehead displays totals by level.
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.ForeSystem;
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Pivot;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Pivot: IPivot;
LHeader: IPivotHeader;
LevTotals: IPivotTotals;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get display settings of report data table
Pivot := Express.Pivot;
// Get collection of dimensions located by rows
LHeader := Pivot.LeftHeader;
// Get object used to work with totals by hierarchy
LevTotals := LHeader.LevelTotals;
If Not LevTotals.HasTotals Then
LevTotals.Totals := Tristate.tsOnOption;
End If;
// Set aggregation method - sum
LevTotals.Method := BasicAggregatorOperation.baoSum;
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
See also: