RemoveByIndex(Index: Integer; [KeepText: Boolean = False]);
RemoveByIndex(Index: integer; KeepText: boolean);
Index. Index of the text field, which must be removed.
KeepText. Indicates whether text of the removed text field must be saved. Default value - False.
The RemoveByIndex method enables the user to remove text box of the regular report by the specified index.
Executing the example requires a form with the components on it: UiReport, ReportBox and Button with the identifiers: UiReport1, ReportBox1 and Button1. A regular report is connected to the UiReport component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Report: IPrxReport;
Doc: IPrxDocument;
TFs: IPrxTextFields;
i: Integer;
Begin
Report := UiReport1.Instance As IPrxReport;
Doc := Report.Sheets.FindByName("Document1") As IPrxDocument;
TFs := Doc.TextFields;
Report.Recalc;
For i := Tfs.Count - 1 To 0 Step - 1 Do
TFs.RemoveByIndex(i, True);
End For;
End Sub Button1OnClick;
After executing the example text fields found by the specified index are removed.
Executing the example requires a form with the components on it: UiReportNet, ReportBoxNet and Button with the identifiers: UiReportNet1, ReportBoxNet1 and Button1. A regular report is connected to the UiReportNet component.
Imports Prognoz.Platform.Interop.Report;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Report: IPrxReport;
Doc: IPrxDocument;
TFs: IPrxTextFields;
Tf: IPrxTextField;
i: Integer;
Begin
Report := UiReportNet1.Object.Edit() As IPrxReport;
Doc := Report.Sheets.FindByName("Document1") As IPrxDocument;
TFs := Doc.TextFields;
Report.Recalc();
For i := Tfs.Count - 1 To 0 Step - 1 Do
TFs.RemoveByIndex(i, True);
End For;
End Sub;
After executing the example text fields found by the specified index are removed.
See also: