HierarchyDictKey: Integer;
The HierarchyDictKey property determines the dictionary key that will be used as an alternative hierarchy.
it is relevant if the HierarchyTypeSource property is set to AltHierarchySourceEnum.FromDictionary. As a property value specify the dictionary key, based on which an alternative hierarchy is created for the dictionary, on which the current dimension is based.
Executing the example requires that the repository contains a data entry form with the DEF_DORM identifier. A table area is created in the data entry form. A dimension based on the DICT_FIRMS dictionary is added in the table area. An alternative hierarchy based on the ALT_DICT_FIRMS dictionary is created for this dictionary.
Add links to the Dimensions and Metabase system assemblies. Add links to the assemblies required for working with data entry forms.
Sub UserProc;
Var
Mb: IMetabase;
DEF: IDataEntryForm;
TArea: IDefTableArea;
Dim: IDefDimension;
Begin
Mb := MetabaseClass.Active;
// Data entry/output form
DEF := New DataEntryForm.CreateByDataEntryForm(Mb.ItemById("DEF_FORM"), True);
// Get dimension
TArea := DEF.InputAreas.Item(0) As IDefTableArea;
Dim := TArea.DefDimensions.ItemByKey(Mb.GetObjectKeyById("DICT_FIRMS"));
// Alternative hierarchy for dimension
Dim.HierarchyTypeSource := AltHierarchySourceEnum.FromDictionary;
Dim.HierarchyDictKey := Mb.GetObjectKeyById("ALT_DICT_FIRMS");
// Apply changes
DEF.InputAreas.ApplyAreaToReport(TArea.Id);
// Save changes
DEF.Save;
DEF._Dispose;
End Sub UserProc;
After executing the example the specified table area dimension settings are changed. Fixed alternative hierarchy is set for dimension.
See also: