IAdoMdAxis.Open

Fore Syntax

Open: IDalCursor;

Fore.NET Syntax

Open(): Prognoz.Platform.Interop.Dal.IDalCursor;

Description

The Open method returns the cursor with information about the coordinates available on the axis.

Comments

Each cursor entry describes a certain axis coordinate. The first field of the cursor is named TUPLE_ORDINAL and returns the coordinate index as a value. Other fields contain information according to the attributes, that are defined for dimension.

An additional record is added to the cursor to split the information by specific coordinates. The first field in this record has no name and the hierarchy number is used as the field value.

Fore Example

Executing the example requires that the repository contains an ADOMD catalog with the ADOMDTest identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Catalog: IAdoMdCatalogInstance;
    Connection: IAdoMdConnection;
    sMDX: String;
    Cellset: IAdoMdCellset;
    AxisInfo: IAdoMdAxisInfo;
    Axis: IAdoMdAxis;
    AxisCursor: IDalCursor;
    Fields: IDalCursorFields;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Catalog := MB.ItemById("ADOMDTest").Open(NullAs IAdoMdCatalogInstance;
    Connection := Catalog.Connection;
    sMDX := "SELECT ...";
    Cellset := Connection.Cellset(sMDX);
    AxisInfo := Cellset.AxisInfo;
    //First axis
    Axis := AxisInfo.Item(0);
    //First axis coordinates
    AxisCursor := Axis.Open;
    //Fields with each coordinate description
    Fields := AxisCursor.Fields;
    Debug.Writeline("Coordinates number:" + Axis.Count.ToString);
    While Not AxisCursor.Eof Do
        For i := 0 To Fields.Count - 1 Do
            Debug.Writeline(Fields.Item(i).Name + " | " + Fields.Item(i).Value);
        End For;
        AxisCursor.Next;
    End While;
End Sub UserProc;

A multidimensional query is executed for the cubes of the specified ADOMD catalog on executing the example. The information about the axes, on which the data is formed, is obtained from execution result. This information about each coordinate axis 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. This procedure is an entry point of the .NET assembly.

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;
    sMDX: String;
    Cellset: IAdoMdCellset;
    AxisInfo: IAdoMdAxisInfo;
    Axis: IAdoMdAxis;
    AxisCursor: IDalCursor;
    Fields: IDalCursorFields;
    i: Integer;
Begin
    MB := Params.Metabase;
    Catalog := MB.ItemById["ADOMDTest"].Open(NullAs IAdoMdCatalogInstance;
    Connection := Catalog.Connection;
    sMDX := "SELECT ...";
    Cellset := Connection.Cellset(sMDX);
    AxisInfo := Cellset.AxisInfo;
    //First axis
    Axis := AxisInfo.Item[0];
    //First axis coordinates
    AxisCursor := Axis.Open();
    //Fields with each coordinate description
    Fields := AxisCursor.Fields;
    System.Diagnostics.Debug.Writeline("Coordinates number:" + Axis.Count.ToString());
    While Not AxisCursor.Eof() Do
        For i := 0 To Fields.Count - 1 Do
            System.Diagnostics.Debug.Writeline(Fields.Item[i].Name + " | " + Fields.Item[i].Value);
        End For;
        AxisCursor.Next();
    End While;
End Sub;

A multidimensional query is executed for the cubes of the specified ADOMD catalog on executing the example. The information about the axes, on which the data is formed, is obtained from execution result. This information about each coordinate axis is displayed in the development environment console.

See also:

IAdoMdAxis