IEaxDataSources.Add

Syntax

Add(DataSource: IMatrixDataSource): IEaxDataSource;

Parameters

DataSource. Multidimensional data source that should be added to express report.

Description

The Add method adds a data source to express report.

Comments

The method returns the object containing the added data source.

When more than one data source is added to the express report, a virtual cube will be created that will combine these data sources. This cube will be a hidden child object of the express report. To work with cube data, use the IPivot.DataSource property.

Example

Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier and a cube with the CUBE identifier. The express report is based on one data source.

Add links to the Cubes, Express, Matrix, Metabase, and Pivot system assemblies.

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").Open(NullAs 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;

After executing the example, the data source is added to the express report. An original data source of express report is also included to the data sources collection for correct creating of virtual cube.

See also:

IEaxDataSources