IEaxDataSources.FindByKey

Syntax

FindByKey(Key: Integer): IEaxDataSource;

Parameters

Key. Data source key.

Description

The FindByKey method searches for data source in the data sources collection by key.

Comments

The method returns the object containing express report data source.

Example

Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier.

Add links to the Express and Metabase system assemblies.

Sub Main;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Expr: IEaxAnalyzer;
    ExpDs: IEaxDataSources;
    Exp: IEaxDataSource;
    Res: String;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("EXPRESS_REPORT").Edit;
    Expr := MObj As IEaxAnalyzer;
    ExpDs := Expr.DataSources;
    Exp := ExpDs.FindByKey(3);
    If Exp <> Null
    Then Res := "Find";
    Else Res := "Don't find";
    End If;
    MObj.Save;
End Sub Main;

After executing the example the Res variable contains Find, if the collection of express report data sources contains a data source with the 3 key.

See also:

IEaxDataSources