Add(DataSource: IMatrixDataSource): IEaxDataSource;
DataSource. Multidimensional data source that is to be added to express report.
The Add method adds a data source to express report and returns the object containing added source.
The cube is created ,when adding more than one data source to the express report to merge that sources. This cube is a hidden child object of express report. To work with data, use the property IPivot.DataSource.
Executing the example requires that the repository contains an express report with the EXPRESS identifier and a cube with the CUBE_2 identifier. Express report is based on one data source.
Sub UserProc;
Var
MB: IMetabase;
Expr: IEaxAnalyzer;
ExprDS: IEaxDataSources;
Cube: ICubeInstance;
MatrDS: IMatrixDataSource;
Begin
MB := MetabaseClass.Active;
Expr := MB.ItemById("EXPRESS_REPORT").Edit As IEaxAnalyzer;
ExprDS := Expr.DataSources;
Cube := MB.ItemById("CUBE_2").Open(Null) As ICubeInstance;
MatrDS := Cube.Destinations.DefaultDestination As IMatrixDataSource;
//Adding the original data source to the collection
ExprDS.Add(Expr.Pivot.DataSource);
//Adding the second source to the collection
ExprDS.Add(MatrDS);
(Expr As IMetabaseObject).Save;
End Sub UserProc;
The data source is added to the express report at the example execution. Original source of express report is also included to the data sources collection for correct generation of virtual cube.
Executing the example requires that the repository contains an express report with the EXPRESS identifier and a cube with the CUBE_2 identifier. The express report is based on one data source. Selected procedure is an entry point for the .NET assembly.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Pivot;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Expr: IEaxAnalyzer;
ExprDS: IEaxDataSources;
Cube: ICubeInstance;
MatrDS: IMatrixDataSource;
Begin
MB := Params.Metabase;
Expr := MB.ItemById["EXPRESS_REPORT"].Edit() As IEaxAnalyzer;
ExprDS := Expr.DataSources;
Cube := MB.ItemById["CUBE_2"].Open(Null) As ICubeInstance;
MatrDS := Cube.Destinations.DefaultDestination As IMatrixDataSource;
//Adding the original data source to the gallery
ExprDS.Add(Expr.Pivot.DataSource);
//Adding the second source to the gallery
ExprDS.Add(MatrDS);
(Expr As IMetabaseObject).Save();
End Sub;
The data source is added to the express report at the example execution. Original source of express report is also included to the data sources gallery for correct generation of virtual cube.
See also: