Group: String;
The Group property determines value of the GROUP parameter in binding string.
The GROUP parameter determines identifier of the group of elements that delimits elements available in the editor.
The Group property is available if the GroupDefined property is set to True. If the Group property is changed, the GroupDefined property is automatically set to True.
Function CreateDimComboBinding(Dimension: IMetabaseObjectDescriptor): String;
Var
BM: IBindingManager;
DimChildren: IMetabaseObjectDescriptors;
DimModel: IDimensionModel;
DimInst: IDimInstance;
Selection: IDimSelection;
Group: IDimElementGroup;
Schema: IDimSelectionSchema;
RdsDict: IRdsDictionary;
LvlKey, AttrKey: Integer;
DimComboBinding: IBindingDimCombo;
Begin
BM := New BindingManager.Create;
DimModel := Dimension.Bind As IDimensionModel;
DimChildren := Dimension.Children;
//Set up parameters
DimComboBinding := BM.CreateByUi("DimCombo") As IBindingDimCombo;
//Check if the group of elements of the selection schema is present
//It is expected that the first child object is a group of elements,
//the second is the selection schema
If DimChildren.Count >= 2 Then
Group := DimChildren.Item(0).Bind As IDimElementGroup;
Schema := DimChildren.Item(1).Bind As IDimSelectionSchema;
DimComboBinding.Group := (Group As IMetabaseObject).Id;
DimComboBinding.Schema := (Schema As IMetabaseObject).Id;
//Create values from names
DimInst := Dimension.Open(Null) As IDimInstance;
Selection := DimInst.CreateSelection;
Schema.ProcessInplace(Selection, Group);
DimComboBinding.ValueAttribute := "NAME";
DimComboBinding.ValueDefined := True;
DimComboBinding.Value := Selection.ToString;
End If;
//Identifiers as the name of level elements if the level exists
If DimModel.Levels.Count >= 1 Then
LvlKey := DimModel.Levels.Item(0).Key;
AttrKey := DimModel.Attributes.Id.Key;
DimComboBinding.LevelAttribute := "0{" + LvlKey.ToString + "*" + AttrKey.ToString + "}";
End If;
DimComboBinding.Object := Dimension.Id;
//Multiple selection
DimComboBinding.SelectionMode := SelectionModeEnum.MultiSelect;
//Template for creating a name on multiple selection
DimComboBinding.CustomMultiselectText := "Range: %First-%Last";
Return DimComboBinding.AsString;
End Function CreateDimComboBinding;
This function generates a binding string to use the value editor as a drop-down list of the dictionary. Dictionary description is passed as the Dimension input parameter. Depending on the dictionary structure, the following is set in editor settings: group of elements and selection schema, format of first-level element names. The value in the cell will be formed by means of element names.
See also: