IEaxDataSources.RemoveByKey

Syntax

RemoveByKey(Key: Integer): Boolean;

Parameters

Key: Data source key.

Description

The RemoveByKey method removes a data source from the collection of express report sources by the source key. A data source key is passed by the Key parameter. This method returns True if a data source is successfully deleted.

Example

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

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Expr: IEaxAnalyzer;

ExpDs: IEaxDataSources;

Res: String;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemById("EXPRESS_REPORT").Edit;

Expr := MObj As IEaxAnalyzer;

ExpDs := Expr.DataSources;

If ExpDs.RemoveByKey(3)

Then Res :="Remove";

Else Res :="Don't remove";

End If;

MObj.Save;

End Sub Main;

After executing this example the variable Res contains Remove if the express report data source with the key 3 has been successfully deleted.

See also:

IEaxDataSources