The RichTextBox control is used to display, insert, and manipulate formatted text. It is different from the TextBox control in several ways. The most obvious is that it allows you to apply different formatting to different parts of its content.
You can add fields to the text you enter directly in the RichTextBox control by right-clicking and choosing Insert Fields and providing a field name or you can load an RTF, an HTML, or a Text file into the control.
ActiveReports supports most of the XHTML 1.1 standard; please see Wikipedia for more information. The limited support for reading XHTML5 and HTML5 documents is also available. The RichTextBox control supports formats such as:
With the control selected on the report, in the Commands section at the bottom of the Properties panel, you can click Load file to open the dialog. This allows you to select a file to load into the control at design time. Supported file types are as follows.
When you load a RichText file, the control will display the file in edit mode.
When you load a Text or an HTML file, the control will display the HTML markup in the edit mode.
Important: The HTML text in an HTML file, loaded into the RichTextBox control, must be enclosed in the <body></body> tags. Otherwise, the HTML data is converted into RTF.
Property | Description |
---|---|
CanGrow | Determines whether ActiveReports should increase the height of the control based on its content. |
CanShrink | Determines whether ActiveReports should decrease the height of the field based on its value. |
RenderRtfAsContinuousImage |
If True (default), the property renders the content as one continuous image split across the pages. This property is actual if RtfRenderingType property is set to either Metafile or PNG.
Note: This property should be set to 'False' if the RtfRenderingType property is set to a Metafile or PNG, to avoid any trimmed text at the end of the pages.
|
RtfRenderingType | Renders the RTF control with a legacy renderer or with the WordPad as a metafile or raster image. Only the legacy RTF renderer supports fields. |
DataField | Gets or sets the field name from the data source to bind to the control. |
You can set the RichTextBox properties in the RichTextBox dialog. To open it, with the RichTextBox selected on the report, under the Properties panel, click the Property dialog link.
The RichTextBox control supports HTML tags and attributes same as the FormattedText control. For more information, please see the topic on FormattedText.
[Paste the following section into an RTF File]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Customer List by Country
Argentina
Austria
Belgium
Brazil
HTML code. Paste in a NotePad file. |
Copy Code
|
---|---|
<html> <body> <center><h1>Customer List by Country</h1></center> <h1>Argentina</h1> <ul> <li>Rancho grande <li>Océano Atlántico Ltda. <li>Cactus Comidas para llevar </ul> <h1>Austria</h1> <ul> <li>Piccolo und mehr <li>Ernst Handel </ul> <h1>Belgium</h1> <ul> <li>Suprêmes délices <li>Maison Dewey </ul> <h1>Brazi1> <ul> <li>Familia Arquibaldo <li>Wellington Improtadora <li>Que Delícia <li>Tradição Hipermercados <li>Ricardo Adocicados <li>Hanari Carnes <li>Queen Cozinha <li>Comércio Mineiro <li>Gourmet Lanchonetes </ul> </body> </html> |
ActiveReports also provides limited support for reading XHTML5 and HTML5 documents.
In the edit mode, you can use the following keyboard shortcuts.
Key Combination | Action |
---|---|
Enter | New line. |
Alt + Enter | Saves modifications and exits edit mode. |
Esc | Cancels modifications and exits edit mode. |