IPivot.DataSource

Syntax

DataSource: IMatrixDataSource;

Description

The DataSource property determines the data source, which data is contained in the table.

Comments

On working with an object, on which a table of the express report is based, a data source of the express report can be determined in this property.

If the express report is based on multiple data sources, access to it is executed by the IEaxAnalyzer.DataSources property. In this case the DataSource property returns display version instance of virtual cube, which merges express report data sources. This virtual cube will be a child object of the express report.

Fore Example

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

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Expr: IEaxAnalyzer;
    CubeInst: ICubeInstance;
    CubeDest: ICubeInstanceDestination;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("EXPRESS_REPORT").Edit;
    CubeInst := MB.ItemById("Cube_2").Open(NullAs ICubeInstance;
    CubeDest := CubeInst.Destinations.DefaultDestination;
    Expr := MObj As IEaxAnalyzer;
    Expr.Pivot.DataSource := CubeDest As IMatrixDataSource;
    MObj.Save;
End Sub UserProc;

On executing the example the data source is changed in the express report.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

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;
    MObj: IMetabaseObject;
    Expr: IEaxAnalyzer;
    CubeInst: ICubeInstance;
    CubeDest: ICubeInstanceDestination;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["EXPRESS_REPORT"].Edit();
    CubeInst := MB.ItemById["Cube_2"].Open(NullAs ICubeInstance;
    CubeDest := CubeInst.Destinations.DefaultDestination;
    Expr := MObj As IEaxAnalyzer;
    Expr.Pivot.DataSource := CubeDest As IMatrixDataSource;
    MObj.Save();
End Sub;

See also:

IPivot