IPivotDimensionSettings.KeepLeafParents

Syntax

KeepLeafParents: 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.

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.

See also:

IPivotDimensionSettings