RemoveByKey(Key: Integer): Boolean;
Key. Data source key.
The RemoveByKey method removes a data source from the collection of express report sources by key.
Available values:
True. The removal is successful.
False. The removal is executed with errors.
A data source key is sent using the Key parameter.
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;
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 the example the Res variable contains Remove if the express report data source with the 3 key has been successfully removed.
See also: