IDimHierarchyInstance.Source

Fore Syntax

Source: IDimInstance;

Fore.NET Syntax

Source: Prognoz.Platform,Interop.Dimensions.IDimInstance;

Description

The Source property determines data of the dictionary used as alternative hierarchy source (IDimHierarchy.Source).

Comments

If this property is undetermined, data opens with default parameters.

Fore Example

Executing the example requires a form containing the Button component with the Button1 identifier and the component MetaAttributesBreadcrumb with the MetaAttributesBreadcrumb1 identifier.

The repository should contain a time series database with the DIM_HIERARCHY identifier. This base should contain a custom attribute referring to the dictionary with built-in alternative hierarchy. At least one dictionary element should be selected for the MetaAttributesBreadcrumb1 component.

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

Add links to the Metabase, Dimensions and Cubes system assemblies.

Sub OBJ8511FormOnCreate(Sender: Object; Args: IEventArgs);
Var
    MB: IMetabase;
    RubInst: IRubricatorInstance;
Begin
    MB := MetabaseClass.Active;
    RubInst := MB.ItemById("DIM_HIERARCHY").Open(NullAs IRubricatorInstance;
    MetaAttributesBreadcrumb1.Rubricator := RubInst;
End Sub OBJ8511FormOnCreate;

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Items: IBreadcrumbItems;
    Item: IMetaAttributeBreadcrumbItem;
    Attr: IMetaAttribute;
    AttrS: IMetaAttributeSettings;
    AttrSett: IMetaAttributeSetting;
    DimInst, DimInstS: IDimInstance;
    DimHInst: IDimHierarchyInstance;
Begin
    Items := MetaAttributesBreadcrumb1.Items;
    Item := Items.Item(0As IMetaAttributeBreadcrumbItem;
    Attr := Item.MetaAttribute;
    DimInst := Attr.ValuesObject.Open(NullAs IDimInstance;
    AttrS := MetaAttributesBreadcrumb1.MetaAttributeSettings;
    AttrSett := AttrS.FindByAttribute(Attr);
    AttrSett.DimHierarchy := DimInst.Hierarchies.Item(0);
    // Addressing the dictionary, that is a source of alternative hierarchy
    DimHInst := DimInst.Hierarchies.Item(0);
    Debug.WriteLine("Data of dictionary of alternative hierarchy");
    DimInstS := DimHInst.Source;
    Debug.Indent;
    Debug.WriteLine("Dictionary identifier: " + DimInstS.Ident);
    Debug.WriteLine("Dictionary key: " + DimInstS.Key.ToString);
    Debug.WriteLine("Dictionary name: " + DimInstS.Name);
    Debug.Unindent;
End Sub Button1OnClick;

After executing the example data of the dictionary that is alternative hierarchy are displayed in the console window: its identifier. key and name.

Fore.NET Example

Executing the example requires a form containing the Button component with the button1 identifier and the MetaAttributesBreadcrumbNet component with the metaAttributesBreadcrumbNet1 identifier.

The repository should contain a time series database with the DIM_HIERARCHY identifier. This base should contain a custom attribute referring to the dictionary with built-in alternative hierarchy. At least one dictionary element should be selected for the metaAttributesBreadcrumbNet1 component.

Example is the Click event handler for the Button1 component.

Add links to the Cubes, Dimensions, ExtCtrls, Forms, Rds system assemblies.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.ExtCtrls;
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Rds;

Private Sub OBJ8524Form_Load(sender: System.Object; e: System.EventArgs);
Var
    MB: IMetabase;
    RubInst: IRubricatorInstance;
Begin
    MB := Self.Metabase;
    RubInst := MB.ItemById["DIM_HIERARCHY"].Open(NullAs IRubricatorInstance;
    metaAttributesBreadcrumbNet1.Rubricator := RubInst;
End Sub;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Items: IBreadcrumbItems;
    Item: IMetaAttributeBreadcrumbItem;
    Attr: IMetaAttribute;
    AttrS: IMetaAttributeSettings;
    AttrSett: IMetaAttributeSetting;
    DimInst, DimInstS: IDimInstance;
    DimHInst: IDimHierarchyInstance;
Begin
    Items := metaAttributesBreadcrumbNet1.CtrlBox.Items;
    Item := Items.Item[0As IMetaAttributeBreadcrumbItem;
    Attr := Item.MetaAttribute;
    DimInst := Attr.ValuesObject.Open(NullAs IDimInstance;
    AttrS := metaAttributesBreadcrumbNet1.CtrlBox.MetaAttributeSettings;
    AttrSett := AttrS.FindByAttribute(Attr);
    AttrSett.DimHierarchy := DimInst.Hierarchies.Item[0];
    // Addressing the dictionary, that is a source of alternative hierarchy
    DimHInst := DimInst.Hierarchies.Item[0];
    System.Diagnostics.Debug.WriteLine("Data dictionary of alternative hierarchy");
    DimInstS := DimHInst.Source;
    System.Diagnostics.Debug.Indent();
    System.Diagnostics.Debug.WriteLine("Dictionary identifier: " + DimInstS.Ident);
    System.Diagnostics.Debug.WriteLine("Dictionary key: " + DimInstS.Key.ToString());
    System.Diagnostics.Debug.WriteLine("Dictionary name: " + DimInstS.Name);
    System.Diagnostics.Debug.Unindent();
End Sub;

See also:

IDimHierarchyInstance