IPrxTextFields.RemoveByKey

Fore Syntax

RemoveByKey(Key: Integer; [KeepText: Boolean = False]);

Fore.NET Syntax

RemoveByKey(System.Int32, boolean);

Parameters

Key. A key of the text field, which must be removed.

KeepText. Indicates whether text of the removed text field must be saved. The default property value - False.

Description

The RemoveByKey method enables the user to remove text box of the regular report by the specified key.

Fore Example

Function RemoveFieldByKey(Report: IPrxReport; KeyField: Integer): Boolean;
Var
    Doc: IPrxDocument;
    TFs: IPrxTextFields;
    TF: IPrxTextField;
Begin
    Doc := Report.Sheets.FindByName("Document1"As IPrxDocument;
    TFs := Doc.TextFields;
    Report.Recalc;
    TF := TFs.FindByKey(KeyField);
    If TF <> Null Then
        TFs.RemoveByKey(KeyField, True);
        Return True
    Else
        Return False
    End If;
End Function RemoveFieldByKey;

A regular report containing a text sheet with the Document1 name in its structure should be passed as the Report input parameter. When the specified function is executed, True is returned if the specified text box exists and can be removed.

Fore.NET Example

Function RemoveFieldByKey(Report: IPrxReport; KeyField: Integer): Boolean;
Var
    Doc: IPrxDocument;
    TFs: IPrxTextFields;
    TF: IPrxTextField;
Begin
    Doc := Report.Sheets.FindByName("Document1"As IPrxDocument;
    TFs := Doc.TextFields;
    Report.Recalc();
    TF := TFs.FindByKey(KeyField);
    If TF <> Null Then
        TFs.RemoveByKey(KeyField, True);
        Return True
    Else
        Return False
    End If;
End Function RemoveFieldByKey;

A regular report containing a text sheet with the Document1 name in its structure should be passed as the Report input parameter. When the specified function is executed, True is returned if the specified text box exists and can be removed.

See also:

IPrxTextFields