Show contents 

Tab > Tab Assembly Interfaces > ITabRange > ITabRange.Prefix

ITabRange.Prefix

Syntax

Prefix: Variant;

Description

The Prefix property determines a table cell prefix.

Comments

The prefix is displayed before table cell value. It does not participate in calculation of conditional formatting or calculating formulas.

Example

Executing the example requires a form that contains the Button component with the Button1 identifier, the TabSheetBox component with the TabSheetBox1 identifier and the Source property which is set to the UiErAnalyzer component with the UiErAnalyzer1 identifier. The UiErAnalyzer1 component of the Active property is set to True and the Object property is set to ready express report. The example is a handler of the OnClick event for the Button1 component:

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Tsheet: ITabSheet;
    Range: ITabRange;
    i, r, c: integer;
Begin
    TSheet := TabSheetBox1.Source.GetTabSheet;
    r := TSheet.MaxUsedRow;
    c := TSheet.MaxUsedColumn;
    // Select all table cells, except for heading
    Range := Tsheet.Cells(10, r, c);
    // Set suffix and prefix for the entire range
    Range.Prefix := "price: ";
    Range.Suffix := " $";
    // Write separate suffixes and prefixes to the last column
    i := 1;
    While (i <= r) Do
        TSheet.CellPrefix(i, c) := "total: ";
        TSheet.CellSuffix(i, c) := " usd";
        i := i + 1;
    End While;
    // Fit column width to the new contents
    Range.AdjustWidth;
End Sub Button1OnClick;

As a result of executing the example, after button clicking, prefixes and suffixes are added to table cells.

Before example execution:

After example execution:

See also:

ITabRange