Show contents 

Express > Express Assembly Interfaces > IEaxAnalyzeCore > IEaxAnalyzeCore.OpenMatrixDataSource

IEaxAnalyzeCore.OpenMatrixDataSource

Syntax

OpenMatrixDataSource(DataSource: IMatrixDataSource);

Parameters

DataSource. Abstract multidimensional data source, which data should be loaded to express report.

Description

The OpenMatrixDataSource property loads data to the express report from a non-cube source.

Comments

For example, data of modeling variables obtained as a result of a modeling problem calculation can be used as a non-cube source. Access to data variables is executed by means of the VariableStub property.

Example

Executing the example requires a form with a button named Button1, the UiErAnalyzer component named UiErAnalyzer1 and other components displaying data of the express report loaded to UiErAnalyzer1. The repository contains a modeling container with the KONT_MODEL identifier. This container contains a modeling problem with the Problem_1 identifier configured to calculate models.

Sub Button1OnClick(Sender:Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Expr: IEaxAnalyzer;
    Problem: IMsProblem;
    Setting: IMsProblemCalculationSettings;
    Calc: IMsProblemCalculation;
    MDS: IMatrixDataSource;
Begin
    // Temporary express report
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
    Expr := MB.CreateObject(CrInfo).Edit As IEaxAnalyzer;
    // Calculated modeling problem
    Problem := MB.ItemByIdNamespace("PROBLEM", MB.ItemById("KONT_MODEL").Key).Bind As IMsProblem;
    Setting := Problem.CreateCalculationSettings;
    // Calculate modeling problem
    Calc := Problem.Calculate(Setting);
    // Data by the first output variable
    MDS := Calc.VariableStub(Problem.VariableStubs(MsVariableKind.Output).Item(0));
    // Load to express report
    Expr.OpenMatrixDataSource(MDS);
    // Load express report to UiErAnalyzer1
    UiErAnalyzer1.ErAnalyzer := Expr;
    UiErAnalyzer1.Active := True;
End Sub Button1OnClick;

After executing the example the PROBLEM modeling problem is calculated. Report on the first output variable is loaded to the UiErAnalyzer1 component. Data is displayed in all components using UiErAnalyzer1 as a data source.

See also:

IEaxAnalyzeCore