PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview of the RTF control
  • The RTF control can only be used in a report
  • How to modify the text of an RTF control in a report?
  • Notes
  • Limitations
  • Changing a Static control or an Item control into an RTF control (and conversely)
  • Changing a "Static" control into an "RTF" control
  • Changing an "Item" control into an "RTF" control
  • Transforming an "RTF" control into an "Item" or "Static" control
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview of the RTF control

The RTF control can only be used in a report

The "RTF" (Rich Text Format) control is used to display a formatted character string in your report. This character string is in RTF format, which means that specific tags are used to define the formatting of each character or character string. These tags are not displayed in the control.
For example, an "RTF" control is used to display the following text:
To create an "RTF" control:
  1. In the report editor:
    • click .
    • select "Insert .. New control .. Rich Edit (RTF)".
    On the "Creation" pane, in the "Usual controls" group, click "RTF".
    On the "Creation" pane, in the "Text" group, click "RTF".
  2. Click the position where the control will be created in the report.
Notes:
  • From version 22, the RTF control in a report corresponds to an RTF Static control.
  • In a window, you have the ability to use an RTF edit control or an RTF static control. See Edit control or Static control for more details
How to modify the text of an RTF control in a report?
The text of an "RTF" control can be modified:
  • by programming (..Caption).
    WINDEV Note: You also have the ability to use RTFLoad to assign the RTF control.
  • in the report editor.
To modify the text of the RTF control in the report editor:
  1. Select the control. The selection handles appear around the control.
  2. Click the control again. The mouse cursor turns into an input cursor.
  3. Enter the new text of the control.
  4. The layout toolbar allows you to modify (if necessary) the formatting of the text.
  5. As soon as a click is performed outside the control, the control switches back to read-only.

Notes

  • The text displayed in the RTF control can contain the value of an item printed in the report.
    To insert the value of a report item or control into the text, the name of item or control must be typed between [% and %] characters.
    For example, the control text can correspond to: The [%SupplierName%] supplier sells the [%ProductName%] product at [%PriceIOT%]. The SupplierName, ProductName and PriceIOT items will be replaced by their value when printing the report.
  • The text displayed in the RTF control can come from a text item found in the data source of report.
    If the control is linked to an item, the name of the associated item is displayed in the "Linked item" combo box of the "General" tab of control description.

Limitations

By default:
  • The format of the RTF files supported by the WINDEV and WEBDEV prints is the same as the RTF format supported by "Wordpad" (up to Windows XP). Some additional limits must be noticed when exporting a report to an RTF document (the tables and the text areas are not supported for example).
  • To print an RTF control, the "RICHED20.DLL" file must be found on the current computer. In most cases, the "RICHED20.DLL" file is found in the system directory of Windows.
  • If the RTF file is generated by another tool (Word, ...), we advise you to open the file in Wordpad in order to check the RTF compatibility. The display of the file in Wordpad will provide a better preview of what will be printed.
  • In all cases, we recommend that you re-save the file in Wordpad to force the RTF format.
  • The options for zooming the RTF control are not compatible with the display of links in the text. If links are added by AddLink, the zoom will be automatically forced to 100%.
  • The tables and the images found in an RTF document cannot be retrieved in an RTF control.
    Versions 22 and later
    To retrieve the tables and images of an RTF document in an RTF control, check "RTF with images and tables" ("General" tab in the description window of control). In this case, the compatibility with Wordpad and the presence of RICHED20.DLL are not required anymore.
    New in version 22
    To retrieve the tables and images of an RTF document in an RTF control, check "RTF with images and tables" ("General" tab in the description window of control). In this case, the compatibility with Wordpad and the presence of RICHED20.DLL are not required anymore.
    To retrieve the tables and images of an RTF document in an RTF control, check "RTF with images and tables" ("General" tab in the description window of control). In this case, the compatibility with Wordpad and the presence of RICHED20.DLL are not required anymore.
Versions 17 and later
If you are using iParameter with the "RTFWINDOWS=NO" parameter or with the iRTFWithImagesAndTables constant, you will have the ability to print tables and images in the RTF controls. The compatibility with Wordpad and the presence of RICHED20.DLL are not required anymore.
New in version 17
If you are using iParameter with the "RTFWINDOWS=NO" parameter or with the iRTFWithImagesAndTables constant, you will have the ability to print tables and images in the RTF controls. The compatibility with Wordpad and the presence of RICHED20.DLL are not required anymore.
If you are using iParameter with the "RTFWINDOWS=NO" parameter or with the iRTFWithImagesAndTables constant, you will have the ability to print tables and images in the RTF controls. The compatibility with Wordpad and the presence of RICHED20.DLL are not required anymore.
Changing a Static control or an Item control into an RTF control (and conversely)

Changing a "Static" control into an "RTF" control

To display text in RTF format in a "Static" control:
  1. Display the description window of control ("Description" from the popup menu of control).
  2. In the "Details" tab, check "RTF format".
  3. Validate the description window.
The "Static" control becomes an "RTF" control. All the characteristics of the "Static" control are kept.

Changing an "Item" control into an "RTF" control

To display text in RTF format in an "Item" control:
  1. Display the description window of control ("Description" from the popup menu of control).
  2. In the "Details" tab, check "RTF format".
  3. Validate the description window.
The "Item" control becomes an "RTF" control. All the characteristics of the "Item" control are kept.

Transforming an "RTF" control into an "Item" or "Static" control

To display the RTF tags or to link the control to an item other than a text item:
  1. Display the description window of control ("Description" from the popup menu of control).
  2. In the "Details" tab, clear "RTF format".
  3. Validate the description window.
If the "RTF" control is linked to an item, the "RTF" control becomes an "Item" control. All the characteristics of the "RTF" control are kept.
If the "RTF" control is not linked to an item, the "RTF" control becomes a "Static" control. All the characteristics of the "RTF" control are kept.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment