PC SOFT

WINDEV的在线文档

  • Overview of the RTF control
  • The RTF control can only be used in a report
  • How to modify the text of an RTF control?
  • Notes
  • Limitations
  • Transforming a Static control or an Item control into an RTF control (and conversely)
  • Transforming a "Static" control into an "RTF" control
  • Transforming an "Item" control into an "RTF" control
  • Transforming an "RTF" control into an "Item" or "Static" control
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

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 "创建" pane, in the "常用控件" group, click "RTF".
  2. Click the position where the control must be created in the report.
Note: 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?
The text of an "RTF" control can be modified:
  • by programming (..标签).
    WinDev Note: You also have the ability to use RTF加载数据 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 edit 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 of the static control, type the name of the item or control between the [% and %] characters.
    For example, the text of the control can correspond to: The [%SupplierName%] supplier sells the [%ProductName%] product at [%PriceIOT%]. The SupplierName, ProductName and PriceIOT items will be replaced by their value during the execution of the report.
  • The text displayed in the RTF control can come from a text item found in the data source of the 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 the 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.
  • The tables and the images found in an RTF document cannot be retrieved in an RTF control.
  • 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 添加链接, the zoom will be automatically forced to 100%.
17版本和更高版本
If you are using 打印参数 with the "RTFWINDOWS=NO" parameter or with the 打印.RTF使用图片和表格 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.
17新版本
If you are using 打印参数 with the "RTFWINDOWS=NO" parameter or with the 打印.RTF使用图片和表格 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 打印参数 with the "RTFWINDOWS=NO" parameter or with the 打印.RTF使用图片和表格 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.

Transforming a Static control or an Item control into an RTF control (and conversely)

Transforming a "Static" control into an "RTF" control

To display text in RTF format in a "Static" control:
  1. Display the description window of the control ("Description" from the popup menu of the 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.

Transforming an "Item" control into an "RTF" control

To display text in RTF format in an "Item" control:
  1. Display the description window of the control ("Description" from the popup menu of the 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 the control ("Description" from the popup menu of the 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.