Source: IDimInstance;
The Source property determines data of the dictionary used as alternative hierarchy source (IDimHierarchy.Source).
If this property is undetermined, data opens with default parameters.
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 TESTFormOnCreate(Sender: Object; Args: IEventArgs);
Var
MB: IMetabase;
RubInst: IRubricatorInstance;
Begin
MB := MetabaseClass.Active;
RubInst := MB.ItemById("DIM_HIERARCHY").Open(Null) As IRubricatorInstance;
MetaAttributesBreadcrumb1.Rubricator := RubInst;
End Sub TESTFormOnCreate;
…
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(0) As IMetaAttributeBreadcrumbItem;
Attr := Item.MetaAttribute;
DimInst := Attr.ValuesObject.Open(Null) As 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.
See also: