DimHierarchy: IDimHierarchyInstance;
DimHierarchy: IDimHierarchyInstance;
The DimHierarchy property determines attribute hierarchy.
Use the IMetaAttributeSetting.ShowAttribute property to determine whether the specified MDM dictionary attribute is visible in the drop-down list of values of time series database attribute.
Executing the example requires a form, a button named Button1 on the form and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The repository must contain a time series database with the DIM_HIERARCHY identifier. The database must contain a custom attribute referring to the dictionary with configured alternative hierarchy. At least one dictionary element must be selected for the MetaAttributesBreadcrumb1 component. The example is the OnClick event handler for the Button1 component. Add links to the Cubes, Dimensions, ExtCtrls, Forms, Rds system assemblies.
Add links to the Metabase and Dimensions system assemblies.
Sub SAMPLEFormOnCreate(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 SAMPLEFormOnCreate;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Items: IBreadcrumbItems;
Item: IMetaAttributeBreadcrumbItem;
Attr: IMetaAttribute;
AttrS: IMetaAttributeSettings;
AttrSett: IMetaAttributeSetting;
DimInst: IDimInstance;
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);
End Sub Button1OnClick;
After executing the example the alternative hierarchy is applied to the displayed dictionary elements:
Before applying the alternative hierarchy: .
After applying the alternative hierarchy: .
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
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 SAMPLEForm_Load(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
RubInst: IRubricatorInstance;
Begin
MB := Self.Metabase;
RubInst := MB.ItemById["DIM_HIERARCHY"].Open(Null) As 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: IDimInstance;
Begin
Items := metaAttributesBreadcrumbNet1.CtrlBox.Items;
Item := Items.Item[0] As IMetaAttributeBreadcrumbItem;
Attr := Item.MetaAttribute;
DimInst := Attr.ValuesObject.Open(Null) As IDimInstance;
AttrS := metaAttributesBreadcrumbNet1.CtrlBox.MetaAttributeSettings;
AttrSett := AttrS.FindByAttribute(Attr);
AttrSett.DimHierarchy := DimInst.Hierarchies.Item[0];
End Sub;
See also: