RemoveDimElementTotal(DimKey: Integer; [Element: Integer = -1]): Boolean;
DimKey. Key of the dimension, for element of which calculation of own total is set up.
Element. Dimension element index.
The RemoveDimElementTotal method resets calculation of own total for elements of the specified dimension.
If the Element parameter is not determined or its default value is sent, totals of all dimension elements are reset. If the Element parameter is determined, calculation of own totals type is rest only for the specified element.
The method returns whether total calculation settings are successfully reset for dimension elements.
Executing the example requires that the repository contains a regular report with the REPORT identifier. The data source is added to the report, based on which a slice is created, a data table is added, and calculation of totals is enabled. Calculation of own totals is also enabled for elements of the dimension located in heading.
Add links to the Dimensions, Express, Metabase, Pivot, Report system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Report: IPrxReport;
DataArea: IEaxDataArea;
Pivot: IPivot;
Totals: IPivotEvaluatorTotals;
Begin
Mb := MetabaseClass.Active;
// Open report for edit
Report := Mb.ItemById("REPORT").Edit As IPrxReport;
// Get base for creating an analytical data area slice
DataArea := Report.DataArea;
Pivot := (DataArea.Slices.Item(0) As IEaxDataAreaPivotSlice).Pivot;
// Totals
Totals := Pivot.Evaluator.Totals;
// Reset own totals of dimension elements
Totals.RemoveDimElementTotal(Pivot.TopHeader.Dim(0).Key);
// Save changes
Report.MetabaseObject.Save;
End Sub UserProc;
After executing the example, calculation of own totals is reset for all elements of the dimension located in heading.
See also: