IPivotDimensionSettings.KeepLeafParents

Fore Syntax

KeepLeafParents: TriState;

Fore.NET Syntax

KeepLeafParents: Prognoz.Platform.Interop.ForeSystem.TriState;

Description

The KeepLeafParents property determines whether parent elements are displayed for dimension leaf elements.

Comments

Leaf elements are elements that do not have selected child elements.

To determine whether only parent elements are displayed, use IPivotDimensionSettings.GetKeepLeafParents.

The KeepLeafParents property is used together with the IPivotDimensionSettings.LeafElementsOnly property. If IPivotDimensionSettings.LeafElementsOnly is set to TriState.OnOption, the KeepLeafParents property can be used.

Fore Example

Executing the example requires that the repository contains a regular report with the EAX_LEAF_SETT identifier containing a data table.

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

Sub UserProc;
Var
    mb: IMetabase;
    Eax: IEaxAnalyzer;
    Dim: IPivotDimension;
    Pivot: IPivot;
    PivotDimSett: IPivotDimensionSettingsEx;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get regular report
    Eax := mb.ItemById("EAX_LEAF_SETT").Edit As IEaxAnalyzer;
    // Get data table display settings
    Pivot := Eax.Pivot;
    // Get the first dimension in table sidehead
    Dim := Pivot.LeftHeader.PivotDim(0);
    // Get dimension settings
    PivotDimSett := Dim.Settings;
    // Display only leaf elements
    If Not PivotDimSett.IsLeafElementsOnly Then
        PivotDimSett.LeafElementsOnly := TriState.OnOption;
    End If;
    // Display parent elements for leaf elements
    If Not PivotDimSett.GetKeepLeafParents Then
        PivotDimSett.KeepLeafParents := TriState.OnOption;
    End If;
    // Save changes
    (Eax As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the displaying of leaf elements and their parent elements is set for the first dimension in the table sidehead.

Fore.NET Example

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.Pivot;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Eax: IEaxAnalyzer;
    Dim: IPivotDimension;
    Pivot: IPivot;
    PivotDimSett: IPivotDimensionSettingsEx;
Begin
    // Get current repository
    mb := Params.Metabase;
    // Get regular report
    Eax := mb.ItemById["EAX_LEAF_SETT"].Edit() As IEaxAnalyzer;
    // Get data table display settings
    Pivot := Eax.Pivot;
    // Get the first dimension in table sidehead
    Dim := Pivot.LeftHeader.PivotDim[0];
    // Get dimension settings
    PivotDimSett := Dim.Settings;
    // Display only leaf elements
    If Not PivotDimSett.IsLeafElementsOnly Then
        PivotDimSett.LeafElementsOnly := TriState.tsOnOption;
    End If;
    // Display parent elements for leaf elements
    If Not PivotDimSett.GetKeepLeafParents Then
        PivotDimSett.KeepLeafParents := TriState.tsOnOption;
    End If;
    // Save changes
    (Eax As IMetabaseObject).Save();
End Sub;

See also:

IPivotDimensionSettings