IPivotEvaluatorTotals.EvaluateForSingleElement

Syntax

EvaluateForSingleElement: Boolean;

EvaluateForSingleElement: boolean;

Description

The EvaluateForSingleElement property determines whether totals should be calculated if a level contains only one element.

Comments

Available values:

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. The report contains the table that displays elements of different levels. One of the levels must display only one element.

Add links to the Express, Metabase, Pivot system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    Totals: IPivotEvaluatorTotals;
Begin
    
// Get repository
    MB := MetabaseClass.Active;
    
// Get express report
    Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    
// Get report data table display settings
    Pivot := Express.Pivot;
    
// Get table totals collection
    Totals := Pivot.Evaluator.Totals;
    
// Set type of totals calculated for rows
    Totals.RowTypes := PivotEvaluatorElementType.Sum;
    
// Place totals before dimension elements
    Totals.PlaceBeforeData := True;
    
// Disable calculation of hierarchy totals
    Totals.HierarchyTotals := False;
    
// Enable calculation of totals for one element
    Totals.EvaluateForSingleElement := True;
    
// Save changes
    (Express As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    Totals: IPivotEvaluatorTotals;
Begin
    
// Get repository
    MB := Params.Metabase;
    
// Get express report
    Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    
// Get report data table display settings
    Pivot := Express.Pivot;
    
// Get table totals collection
    Totals := Pivot.Evaluator.Totals;
    
// Set type of totals calculated for rows
    Totals.RowTypes := PivotEvaluatorElementType.peetSum As integer;
    
// Place totals before dimension elements
    Totals.PlaceBeforeData := True;
    
// Disable calculation of hierarchy totals
    Totals.HierarchyTotals := False;
    
// Enable calculation of totals for one element
    Totals.EvaluateForSingleElement := True;
    
// Save changes
    (Express As IMetabaseObject).Save();
End Sub;

After executing the example, row totals are calculated in the table. Calculation is executed by levels and also for the level with one element. Totals are displayed before data cells.

See also:

IPivotEvaluatorTotals