IDimHierarchyCreator.HierarchyInstance

Syntax

HierarchyInstance: IDimHierarchyInstance;

Description

The HierarchyInstance property determines alternative dictionary hierarchy.

Example

To execute the example, place on form:

Determine:

Add links to the Dimensions, ExtCtrls, Forms, Metabase system assemblies.

After the example is running:

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Creator: IDimHierarchyCreator;
Begin
    // Create a dynamically alternative hierarchy
    Creator := New DimHierarchyCreator.Create;
    // Get selection with elements, by which alternative hierarchy is created
    Creator.Selection := DimensionTree1.Selection;
    // Get selection with additional elements
    Creator.AdditionalElements:=DimensionTree2.Selection;
    // Set root element  
    Creator.RootElement:= True;
    Creator.RootElementName:="Root element";
    //Get alternative hierarchy
    DimensionTree2.Selection.Hierarchy := Creator.HierarchyInstance;
    //Display names of grouping elements
    memo1.Lines.Add("Grouping elements:"+Creator.HierarchyInstance.GroupingElements.ToString("NAME",";"));
End Sub Button1OnClick;

After executing the example the component with the DimensionTree2 identifier displays the created dynamically alternative hierarchy with the Root Element root element, and the component with the Memo1 identifier contains grouping element name.

See also:

IDimHierarchyCreator