CreateMultiOlap(DataSource: IMatrixDataSource);
DataSource. Data source used as a base of express report.
The CreateMultiOlap method creates an express report that contains several data sources.
If DataSource is a virtual cube, after calling CreateMultiOlap the collection of report data sources is populated: IEaxAnalyzerCore.DataSources. The virtual cube used as the express report base, cannot be a constant repository object. Indicates whether an object is a constant repository object is determined by the IMetabaseObjectDescriptor.IsPermanent property.
If DataSource is not a virtual cube, a standard express report is created based on one data source with the empty collection IEaxAnalyzerCore.DataSources.
Executing the example requires that the repository contains time series databases with the FC_FIRST and FC_SECOND identifiers. Add links to the Metabase, Cubes, Express and Matrix system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Ci: IMetabaseObjectCreateInfo;
VirtCube: IVirtualCube;
SourceInst, VirtCubeInst: ICubeInstance;
DataSource: IMatrixDataSource;
Eax: IEaxAnalyzer;
Dest: ICubeInstanceDestination;
Begin
Mb := MetabaseClass.Active;
Ci := Mb.CreateCreateInfo;
Ci.Permanent := False;
// Create a new express report
Ci.ClassId := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
Eax := Mb.CreateObject(Ci).Edit As IEaxAnalyzer;
// Create a virtual cube
Ci.ClassId := MetabaseObjectClass.KE_CLASS_VIRTUALCUBE;
VirtCube := Mb.CreateObject(Ci).Edit As IVirtualCube;
// Add the first time series database to the virtual cube
SourceInst := Mb.ItemById("FC_FIRST").Open(Null) As ICubeInstance;
Dest := SourceInst.Destinations.DefaultDestination;
Debug.WriteLine(Dest.Name);
VirtCube.Sources.Add(Dest.DestinationModel);
// Add the second time series database to the virtual cube
SourceInst := Mb.ItemById("FC_SECOND").Open(Null) As ICubeInstance;
Dest := SourceInst.Destinations.DefaultDestination;
Debug.WriteLine(Dest.Name);
VirtCube.Sources.Add(Dest.DestinationModel);
// Create express report based on a ready virtual cube
VirtCubeInst := (VirtCube As IMetabaseObjectDescriptor).Open(Null) As ICubeInstance;
DataSource := VirtCubeInst.Destinations.DefaultDestination As IMatrixDataSource;
Eax.CreateMultiOlap(DataSource);
// Save express report
(Eax As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, an express report is created, which data source is a non-constant virtual cube. The virtual cube is based on two time series databases.
See also: