IMatrixDataSourceExecutor.Execute

Fore Syntax

Execute(Dimensions: IDimSelectionSet): IMatrix;

Fore.NET Syntax

Execute(Dimensions: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet): Prognoz.Platform.Interop.Matrix.IMatrix;

Parameters

Dimensions - selection, according to which matrix is calculated.

Description

The Execute method calculates a matrix with data in accordance with the specified elements selection and calculation parameters.

Comments

Unlike the IMatrixDataSource.Execute method this method takes into account the specified parameters of calculation of an output matrix. When the method is executed, data is extracted from the server by executing formed SQL queries.

Fore Example

Executing the example requires that the repository contains a cube with the Cube_1 identifier. Dictionaries with the Dim_1 and Dim_2 identifiers are set as dimensions of this cube.

Sub UserProc;
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    MatrDS: IMatrixDataSource;
    DimSS: IDimSelectionSet;
    MatrExecutor: IMatrixDataSourceExecutor;
    Matr: IMatrix;
Begin
    MB := MetabaseClass.Active;
    CubeInst := MB.ItemById("Cube_1").Open(NullAs ICubeInstance;
    MatrDS := CubeInst.Destinations.DefaultDestination As IMatrixDataSource;
    MatrExecutor := MatrDS.CreateExecutor;
    (MatrExecutor As IMatrixDataSourceExecutorSetup).DimensionsIntegrityCheck := True;
    DimSS := MatrDS.CreateDimSelectionSet;
    DimSS.FindById("Dim_1").SelectAll;
    DimSS.FindById("Dim_2").SelectAll;
    Try
        Matr := MatrExecutor.Execute(DimSS);
    Except On Ex: Exception Do
        Debug.WriteLine("Dimension creation error.");
        Debug.WriteLine("Error text: " + Ex.Message);
    Finally
    End Try;
End Sub UserProc;

On executing the example an output cube matrix is calculated. During calculation, building of dictionaries that are used to compose selection is checked. If errors occur on building, text of error will be displayed in the development environment console.

Fore.NET Example

Executing the example requires that the repository contains a cube with the Cube_1 identifier. Dictionaries with the Dim_1 and Dim_2 identifiers are set as dimensions of this cube. The specified procedure is an entry point of the .NET assembly.

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    MatrDS: IMatrixDataSource;
    DimSS: IDimSelectionSet;
    MatrExecutor: IMatrixDataSourceExecutor;
    Matr: IMatrix;
Begin
    MB := Params.Metabase;
    CubeInst := MB.ItemById["Cube_1"].Open(NullAs ICubeInstance;
    MatrDS := CubeInst.Destinations.DefaultDestination As IMatrixDataSource;
    MatrExecutor := MatrDS.CreateExecutor(0);
    (MatrExecutor As IMatrixDataSourceExecutorSetup).DimensionsIntegrityCheck := True;
    DimSS := MatrDS.CreateDimSelectionSet();
    DimSS.FindById("Dim_1").SelectAll();
    DimSS.FindById("Dim_2").SelectAll();
    Try
        Matr := MatrExecutor.Execute(DimSS);
    Except On Ex: Exception Do
    Begin
        System.Diagnostics.Debug.WriteLine("Error occurred during building.");
        System.Diagnostics.Debug.WriteLine("Error text: " + Ex.Message);
    End;
    Finally
    End Try;
End Sub;

On executing the example an output cube matrix is calculated. During calculation, building of dictionaries that are used to compose selection is checked. If errors occur on building, text of error will be displayed in the development environment console.

See also:

IMatrixDataSourceExecutor