AxisInfo: IAdoMdAxisInfo;
AxisInfo: Prognoz.Platform.Interop.AdoMd.IAdoMdAxisInfo;
The AxisInfo property returns information about the axes, which form the data obtained as the result of MDX query execution.
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;
i, j: Integer;
Begin
MB := MetabaseClass.Active;
Catalog := MB.ItemById("ADOMDTest").Open(Null) As IAdoMdCatalogInstance;
Connection := Catalog.Connection;
sMDX := "SELECT ...";
Cellset := Connection.Cellset(sMDX);
AxisInfo := Cellset.AxisInfo;
Debug.WriteLine("Axes number: " + AxisInfo.Count.ToString);
For i := 0 To AxisInfo.Count - 1 Do
Debug.WriteLine("Axis: " + i.ToString);
Axis := AxisInfo.Item(i);
Debug.WriteLine("Dimensions number: " + Axis.DimCount.ToString);
For j := 0 To Axis.DimCount - 1 Do
Debug.Indent;
Debug.WriteLine("Dimension: " + Axis.DimName(j) + "; (Attributes number: " + Axis.DimCols(j).ToString + ")");
Debug.Unindent;
End For;
End For;
End Sub UserProc;
A multidimensional query is executed for the cubes of the given ADOMD catalog when executing the example. The information about the axes, on which the data is formed, is obtained from execution result. Information about all axes is displayed in the development environment console: number and names of dimensions, that are used to form axis coordinates, and number of attributes for each dimension, that describe each coordinate.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
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;
i, j: Integer;
Begin
MB := Params.Metabase;
Catalog := MB.ItemById["ADOMDTest"].Open(Null) As IAdoMdCatalogInstance;
Connection := Catalog.Connection;
sMDX := "SELECT ...";
Cellset := Connection.Cellset(sMDX);
AxisInfo := Cellset.AxisInfo;
System.Diagnostics.Debug.WriteLine("Axes number: " + AxisInfo.Count.ToString());
For i := 0 To AxisInfo.Count - 1 Do
System.Diagnostics.Debug.WriteLine("Axis: " + i.ToString());
Axis := AxisInfo.Item[i];
System.Diagnostics.Debug.WriteLine("Dimensions number: " + Axis.DimCount.ToString());
For j := 0 To Axis.DimCount - 1 Do
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine("Dimension: " + Axis.DimName[j] + "; (Attributes number: " + Axis.DimCols[j].ToString() + ")");
System.Diagnostics.Debug.Unindent();
End For;
End For;
End Sub;
See also: