IDimHierarchyCreator.HierarchyInstance

Syntax

HierarchyInstance: IDimHierarchyInstance;

HierarchyInstance: Prognoz.Platform.Interop.Dimensions.IDimHierarchyInstance;

Description

The HierarchyInstance property determines alternative dictionary hierarchy.

Fore and Fore.NET Examples

To execute the example, place on form:

For Fore.NET instead of the Fore components use their analogs.

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
    // Dynamically create alternative hierarchy
    Creator := New DimHierarchyCreator.Create;
    
// Get selection with elements by which alternative hierarchy is generated
    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 name of grouping elements
    memo1.Lines.Add("Grouping elements:"+Creator.HierarchyInstance.GroupingElements.ToString("NAME",";"));
End Sub Button1OnClick;

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.ExtCtrls;
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Metabase;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Creator: IDimHierarchyCreator;

Begin
    
// Dynamically create alternative hierarchy
    Creator := New DimHierarchyCreator.Create();
    
// Get selection with elements by which alternative hierarchy is generated
    Creator.Selection := dimensionTreeNet1.Selection;
    
// Get selection with additional elements
    Creator.AdditionalElements:=dimensionTreeNet2.Selection;
    
// Set root element  
    Creator.RootElement:= True;
    Creator.RootElementName:=
"Root element";
    //Get alternative hierarchy
    dimensionTreeNet2.Selection.Hierarchy := Creator.HierarchyInstance;
    
//Display name of grouping elements
    ElemList := New List < string > ();
    ElemList.Add(
"Grouping elements:"+Creator.HierarchyInstance.GroupingElements.ToString("NAME",";", False));
    textBox1.Lines := ElemList.ToArray();
 
End Sub;

As a result of example execution the component with the DimensionTree2 identifier displays dynamically created alternative hierarchy with the Root Element root element, and the component with the memo 1 identifier (for Fore.NET: with the textBox1 identifier) displays grouping element name.

See also:

IDimHierarchyCreator