OpenCubeEx(CubeInstance: ICubeInstance; Options: EaxOpenCubeOptions);
OpenCubeEx(CubeInstance: Prognoz.Platform.Interop.Cubes.ICubeInstance; Options: Prognoz.Platform.Interop.Express.EaxOpenCubeOptions);
CubeInstance. Cube used as a data source.
Options. Cube opening mode.
The OpenCubeEx method opens a cube (with advanced parameters) used to create the express report.
Available modes:
EaxOpenCubeOptions.None. Use only cube data. Only cube data is loaded.
EaxOpenCubeOptions.DefaultView. Use both data and saved cube view. If the cube has a saved view, this view is loaded. Saved view contains custom settings of the cube view. For example: displayed dimension elements, chart settings, label parameters, and so on. If no saved view is available, only cube data is loaded.
Executing the example requires that the repository contains a cube with the identifier CUBE_SEP.
Add the links to the Metabase, Cubes, and Express system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CreateInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Expr: IEaxAnalyzer;
Cube: ICubeInstance;
Begin
MB := MetabaseClass.Active;
CreateInfo := MB.CreateCreateInfo;
CreateInfo.Id := MB.GenerateId("EXPR_REP");
CreateInfo.ClassId := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
MObj := MB.CreateObject(CreateInfo).Edit;
Expr := MObj As IEaxAnalyzer;
Cube := MB.ItemById("CUBE_SEP").Open(Null) As ICubeInstance;
Expr.OpenCubeEx(Cube, EaxOpenCubeOptions.DefaultView);
MObj.Save;
End Sub UserProc;
After executing this example an express report is created based on the saved view for the CUBE_SEP cube. Identifier of the created report is displayed to the console window.
Executing the example requires that the repository contains a cube with the identifier CUBE_SEP.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
CreateInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Expr: IEaxAnalyzer;
Cube: ICubeInstance;
Begin
MB := Params.Metabase;
CreateInfo := MB.CreateCreateInfo();
CreateInfo.Id := MB.GenerateId("OBJ_EXPR_REP", 0);
CreateInfo.ClassId := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT As integer;
CreateInfo.Parent := MB.ItemById["OBJ23722"];
MObj := MB.CreateObject(CreateInfo).Edit();
Expr := MObj As IEaxAnalyzer;
Cube := MB.ItemById["CUBE_SEP_COPY7"].Open(Null) As ICubeInstance;
Expr.OpenCubeEx(Cube, EaxOpenCubeOptions.eocoDefaultView);
MObj.Save();
System.Diagnostics.Debug.WriteLine(CreateInfo.Id);
End Sub;
After executing this example an express report is created based on the saved view for the CUBE_SEP cube. Identifier of the created report is displayed to the console window.
See also: