IAdoMdCubeInstance.CubeInstance

Fore Syntax

CubeInstance: ICubeInstance;

Fore.NET Syntax

CubeInstance: Prognoz.Platform.Interop.Cubes.ICubeInstance;

Description

The CubeInstance property returns a cube instance described by the ICubeInstance interface.

Example

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

Sub UserProc;
Var
    MB: IMetabase;
    Cube: IAdoMdCubeInstance;
    CrInfo: IMetabaseObjectCreateInfo;
    Expr: IEaxAnalyzer;
Begin
    MB := MetabaseClass.Active;
    //Open cube
    Cube := MB.ItemByIdNamespace("Cube_1", MB.GetObjectKeyById("ADOMDTest")).Open(NullAs IAdoMdCubeInstance;
    //Information for creation of an express report
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
    CrInfo.Id := MB.GenerateId("ADOMDReport");
    CrInfo.Parent := MB.Root;
    //Create express report based on the ADOMD cube
    Expr := MB.CreateObject(CrInfo).Edit As IEaxAnalyzer;
    Expr.OpenCube(Cube.CubeInstance);
    (Expr As IMetabaseObject).Save;
End Sub UserProc;

On executing this example an express report is created using an instance of the ADOMD cube.

Fore.NET Example

Executing the example requires that the repository contains an ADOMD catalog with the ADOMDTest identifier. The catalog contains the ADOMD cube with the Cube_1 identifier. This example is an entry point of the .NET assembly.

Imports Prognoz.Platform.Interop.AdoMd;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Cube: IAdoMdCubeInstance;
    CrInfo: IMetabaseObjectCreateInfo;
    Expr: IEaxAnalyzer;
Begin
    MB := Params.Metabase;
    //Open cube
    Cube := MB.ItemByIdNamespace["Cube_1", MB.GetObjectKeyById("ADOMDTest")].Open(NullAs IAdoMdCubeInstance;
    //Information for creation of an express report
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassId := Convert.ToInt32(MetabaseObjectClass.KE_CLASS_EXPRESSREPORT);
    CrInfo.Id := MB.GenerateId("ADOMDReport"0);
    CrInfo.Parent := MB.Root;
    //Create express report based on the ADOMD cube
    Expr := MB.CreateObject(CrInfo).Edit() As IEaxAnalyzer;
    Expr.OpenCube(Cube.CubeInstance);
    (Expr As IMetabaseObject).Save();
End Sub;

On executing this example an express report is created using an instance of the ADOMD cube.

See also:

IAdoMdCubeInstance