Cells: IDalCursor;
The Cells property returns the cursor that contains information about the set of cells with values obtained as the result of executing MDX query to the cubes.
Executing the example requires that the repository contains an ADOMD catalog with the ADOMDTest identifier. The cube with the Test physical name is contained in the catalog and the dimension with the Dim_1 name is the part of this cube structure.
Sub UserProc;
Var
MB: IMetabase;
Catalog: IAdoMdCatalogInstance;
Connection: IAdoMdConnection;
sMDX: String;
Cellset: IAdoMdCellset;
CellsCursor: IDalCursor;
CFields: IDalCursorFields;
CField: IDalCursorField;
i: Integer;
Begin
MB := MetabaseClass.Active;
Catalog := MB.ItemById("ADOMDTest").Open(Null) As IAdoMdCatalogInstance;
Connection := Catalog.Connection;
sMDX := "SELECT ...";
Cellset := Connection.Cellset(sMDX);
//Cursor
CellsCursor := Cellset.Cells;
CFields := CellsCursor.Fields;
While Not CellsCursor.Eof Do
For i := 0 To CFields.Count - 1 Do
CField := CFields.Item(i);
Debug.WriteLine(CField.Name + " | " + CField.Value);
End For;
CellsCursor.Next;
End While;
End Sub UserProc;
The cursor with the cells values, which are the results of execution of specified multidimensional query, is obtained when executing the example. The results are displayed in the development environment console.
See also: