- 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?
The RTF control (Report editor)
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, 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:
- On the "Creation" tab, in the "Text" group, click "RTF".
- Click at the desired location to create the control in the report.
- 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. For more details, see Edit control or Static control.
How to modify the text of an RTF control in a report?
The text of an "RTF" control can be modified:
- through programming (with the Caption property).
Remark: You can also use RTFLoad to assign a value to the RTF control.
- in the report editor.
To modify the text of the RTF control in the report editor:
- Select the control. The selection handles appear around the control.
- Click the control again. The mouse cursor turns into an input cursor.
- Enter the new text of the control.
- The layout toolbar allows you to modify (if necessary) the formatting of the text.
- As soon as you click outside the control, it switches back to read-only.
- The text displayed in the RTF control can contain the value of an item printed in the report.
To insert the value of an item or a control of the report into the text of the Static control, enter the name of the item or control between [% and %].
For example, the control text can correspond to: The [%SupplierName%] supplier sells the [%ProductName%] product at [%PriceIOT%]. SupplierName, ProductName and PriceIOT will be replaced with their value when the report is executed.
- 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.
- 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 in the Windows system directory.
- If the RTF file is generated by another program (Microsoft Word, etc.), it is recommended to open the file in Wordpad to check the RTF compatibility. Wordpad will provide a more realistic print preview.
- 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.
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.
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.
This page is also available for…