Define Labels and Text in Forms and Reports

Use the Label template to add labels for fields, as well as other text to be displayed on the component.

Create a label

  1. In the Templates tab of the Resource Browser, select the Label template.
  2. Draw the label frame in the Canvas.

Associate a label with a field

Labels that are associated with a field inherit the value of the Label Text property from the field. For more information, see Labels in Forms and Reports.

  1. Rename the field. As you type, a list of fields that are already in the component are listed.

    Smart suggestions when renaming objects

  2. Select suggested name and press Enter. If the Label Text property of the field has a value, that text is displayed.

Tip: You can also associate labels to fields by drawing the label frame, starting from one of the field's sides.

Associate label with field by using field as starting point when drawing the label frame

When you release the mouse, the label is automatically renamed to the same name as the field.

Edit label text

  • To provide the text of the label, select the label and edit its Label Text property in the Properties Inspector, then click the check mark to save the value.
  • To define an access key, precede the letter to be used with a percent sign (%). If you want to include a percent sign in the label, enter a pair of percent signs (%%).
  • To use a language-specific text, use the $text ProcScript function to specify a named message.

    For example, the message text called NAME contains Name for the English language variation and Nom for a French version. By specifying the label text as $text(NAME), the appropriate text will be displayed.

    Tip: Do not use leading or trailing characters when using $text in labels, as this can lead to incorrect text formatting.

Format the label

You can optionally specify the label font, alignment, repetition, or other label properties.

  • In the Canvas, click right-click the label, choose Label, then select the appropriate property.
  • If you draw multiple occurrences of an entity, you can specify how Uniface should handle labels in the repeated occurrences. The choices are:
    • Do not repeat (the default)
    • Repeat
    • Repeat if not empty
    Note: Associated labels are automatically repeated with the occurrence.
  • You can edit the default label properties in the .ini file by editing the definition that begins with .L=ulabel. For example:

    .L=ulabel(transparency=on;labelfont=label)

    It is recommended that you make a backup of the line or the .ini file before changing it.

  • You can dynamically change the text of associated labels using the $labelproperties ProcScript function. For example:

    $labelproperties(FLD1)="Dept."

Related Topics