RowTotalName(Type: PivotEvaluatorElementType): String;
Type. Type of totals displayed by rows.
The RowTotalName property determines a custom name of totals displayed by rows.
If property value is not set, default total name is displayed.
To determine custom names of totals displayed by columns, use the IPivotEvaluatorTotals.ColumnTotalName property.
Executing the example requires that the repository contains an express report with the EXPRESS identifier. The report must contain a data table built on a cube.
Add links to the Express, Metabase, Pivot, Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MBDes: IMetabaseObjectDescriptor;
Express: IEaxAnalyzer;
Pivot: IPivot;
PivEv: IPivotEvaluator;
Totals: IPivotEvaluatorTotals;
Sum, Avg: PivotEvaluatorElementType;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
MBDes := MB.ItemById("EXPRESS");
// Open express report for edit
Express := MBDes.Edit As IEaxAnalyzer;
// Get settings for displaying report data table
Pivot := Express.Pivot;
// Get settings of calculated table indicators
PivEv := Pivot.Evaluator;
// Get collection of table totals
Totals := PivEv.Totals;
Totals.ColumnTotalsEnabled := True;
Totals.RowTotalsEnabled := True;
// Set type of totals calculated for rows
Sum := PivotEvaluatorElementType.Sum;
Totals.RowTypes := Sum;
// Set type of totals calculated for columns
Avg := PivotEvaluatorElementType.Avg;
Totals.ColumnTypes := Avg;
// Set custom name for row totals
Totals.RowTotalName(Sum) := "Sum";
// Set custom name for column totals
Totals.ColumnTotalName(Avg) := " Average";
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, totals are calculated for table rows and columns, for which custom names will be set: Total for totals calculated by rows, and Average for totals calculated by columns.
See also: