IPrxDataSources.Add

Syntax

Add(Value: IMatrixDataSource): IPrxDataSource;

Parameters

Value. Multidimensional data source.

Description

The Add method adds a data source passed by the Value parameter.

Fore Example

Executing the example requires a cube with the CUBE identifier and a regular report with the REGULAR_REPORT identifier. Add links to the Metabase, Report, Cubes, Matrix system assemblies in the unit.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Cube: ICubeInstance;
    Report: IPrxReport;
    MatrDS: IMatrixDataSource;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("REGULAR_REPORT").Edit;
    Cube := MB.ItemById("CUBE").Open(NullAs ICubeInstance;
    Report := MObj As IPrxReport;
    MatrDS := Cube.Destinations.DefaultDestination As IMatrixDataSource;
    DtSources := Report.DataSources;
    DtSource := DtSources.Add(MatrDS);
    MObj.Save;
End Sub UserProc;

After executing the example the cube with the CUBE identifier is added as a regular report data source.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Matrix;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Cube: ICubeInstance;
    Report: IPrxReport;
    MatrDS: IMatrixDataSource;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["REGULAR_REPORT"].Edit();
    Cube := MB.ItemById["CUBE"].Open(NullAs ICubeInstance;
    Report := MObj As IPrxReport;
    MatrDS := Cube.Destinations.DefaultDestination As IMatrixDataSource;
    DtSources := Report.DataSources;
    DtSource := DtSources.Add(MatrDS);
    MObj.Save();
End Sub;

See also:

IPrxDataSources