RemoveByKey(Key: Integer): Boolean;
Key. Series key.
The RemoveByKey method removes a series by the specified key. The method returns True if the series is successfully removed; otherwise it returns False.
Executing the example requires a form with a button named Button1 on the form, the IntegerEdit component named IntegerEdit1. There should be a regular report with the REGULAR_REPORT identifier, which sheet houses a 3D scene with several data series. Add links to the Metabase, Report, Tab, Ui, Forms system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Report: IPrxReport;
S: IPrxScene3D;
Series: IPrxScene3DSeries;
MB: IMetabase;
Tab: ITabSheet;
Begin
MB := MetabaseClass.Active;
Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
Tab := (Report.Sheets.Item(0) As IPRxTable).TabSheet;
S := Tab.Objects.Item(0).Extension As IPrxScene3D;
Series := S.Series;
If Series.RemoveByKey(IntegerEdit1.Value) Then
WinApplication.InformationBox("Object is removed");
Else
WinApplication.InformationBox("Removal error");
End If;
(Report As IMetabaseObject).Save;
End Sub Button1OnClick;
Enter the series key into the row and click the button. After executing the example the appropriate message is displayed.
See also: