HierarchyMembers(Cube: String; Dimension: String; Hierarchy: String): IDalCursor;
Cube. Physical name of the cube.
Dimension. Physical dictionary name.
Hierarchy. Dictionary hierarchy name.
The HierarchyMembers method returns the cursor containing the information about the elements of the specified dictionary hierarchy.
The obtained cursor contains information about all the dictionaries' hierarchies' elements contained in the ADOMD catalog if the Cube, Dimension and Hierarchy parameters are not specified. The cursor with information about elements of one or several hierarchies is obtained depending on what parameters are specified.
A specific record is added to the cursor to divide information by elements. First field in this record has no name and the hierarchy item number is used as the field value.
Executing the example requires that the repository contains an ADOMD catalog with the ADOMDTest identifier. A cube with the Test physical name is contained in this catalog and a dictionary with the Dim_1 name is the part of this cube structure.
Sub UserProc;
Var
MB: IMetabase;
Catalog: IAdoMdCatalogInstance;
Connection: IAdoMdConnection;
HieMember: IDalCursor;
CFields: IDalCursorFields;
CField: IDalCursorField;
i: Integer;
Begin
MB := MetabaseClass.Active;
Catalog := MB.ItemById("ADOMDTest").Open(Null) As IAdoMdCatalogInstance;
Connection := Catalog.Connection;
HieMember := Connection.HierarchyMembers("Test", "Dim_1", "");
CFields := HieMember.Fields;
While Not HieMember.Eof Do
For i := 0 To CFields.Count - 1 Do
CField := CFields.Item(i);
Debug.WriteLine(CField.Name + " | " + CField.Value);
End For;
HieMember.Next;
End While;
End Sub UserProc;
The cursor containing the information about all hierarchies' elements of the specified ADOMD dictionary is obtained on executing an example. This information is displayed in the development environment console.
See also: