DimensionInstance: IDimInstance;
The DimensionInstance property returns an instance of the dictionary described in the IDimInstance interface.
Executing the example requires a form and the UiDimension and DimensionTree components on this form named UiDimension1 and DimensionTree1 respectively. The repository contains the ADOMD catalog with the ADOMDTest identifier. The catalog includes the ADOMD dictionary with the DimTest identifier.
Class TESTForm: Form
UiDimension1: UiDimension;
DimensionTree1: DimensionTree;
Sub TESTFormOnCreate(Sender: Object; Args: IEventArgs);
Var
MB: IMetabase;
ADOMDDim: IAdoMdDimensionInstance;
DimInst: IDimInstance;
Begin
MB := MetabaseClass.Active;
ADOMDDim := MB.ItemByIdNamespace("TestDim", MB.GetObjectKeyById("ADOMDTest")).Open(Null) As IAdoMdDimensionInstance;
UiDimension1.Active := False;
UiDimension1.Instance := ADOMDDim.DimensionInstance;
DimensionTree1.Dimension := UiDimension1;
End Sub TESTFormOnCreate;
End Class TESTForm;
When the form is started, an open instance of the ADOMD dictionary is obtained. The instance is uploaded into the UiDimension1 component, which is set as a data source for DimensionTree1.
See also: