OpenCubeEx(CubeInstance: ICubeInstance; Options: EaxOpenCubeOptions);
CubeInstance. Cube used as a data source.
Options. Cube opening mode.
The OpenCubeEx method opens a cube (with advanced parameters) that is used to create an 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. The 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 CUBE_SEP identifier.
Add 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 the example an express report is created based on the saved view for the CUBE_SEP cube. Identifier of the created report is displayed in the console window.
See also: