IAdoMdConnection.HierarchyMembers

Fore Syntax

HierarchyMembers(Cube: String; Dimension: String; Hierarchy: String): IDalCursor;

Fore Syntax

HierarchyMembers(Cube: string; Dimension: string; Hierarchy: string): Prognoz.Platform.Interop.Dal.;

Parameters

Cube. Physical name of the cube.

Dimension. Physical dictionary name.

Hierarchy. Dictionary hierarchy name.

Description

The HierarchyMembers method returns the cursor containing the information about the elements of the specified dictionary hierarchy.

Comments

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.

Fore Example

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(NullAs 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.

Fore.NET Example

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.

Imports Prognoz.Platform.Interop.AdoMd;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Catalog: IAdoMdCatalogInstance;
    Connection: IAdoMdConnection;
    HieMember: IDalCursor;
    CFields: IDalCursorFields;
    CField: IDalCursorField;
    i: Integer;
Begin
    MB := Params.Metabase;
    Catalog := MB.ItemById["ADOMDTest"].Open(NullAs 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];
            System.Diagnostics.Debug.WriteLine(CField.Name + " | " + CField.Value);
        End For;
        HieMember.Next();
    End While;
End Sub;

The cursor containing the information about all hierarchies' elements of the specified ADOMD dictionary is obtained on executing the example. This information is displayed in the development environment console.

See also:

IAdoMdConnection