RemoveByKey(Key: Integer): Boolean;
Key - key of a control.
The RemoveByKey method removes the control, which key is passed by the Key parameter.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Report: IPrxReport;
Contr: IPrxReportControls;
s: String;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Report").Edit;
Report := MObj As IPrxReport;
Contr := Report.Controls;
If Contr.RemoveByKey(5) Then
s := "Remove";
Else
s := "Don't Remove";
End If;
MObj.Save;
End Sub Main;
After executing the example the "s" variable contains "Remove" if the control with the 5 key is successfully removed. The identifier of the regular report - Report.
See also: