Styling and Formatting HtmlTextBox
The HtmlTextBox enables you to control the style of its text presentation by supporting a set of HTML tags and CSS attributes.
Supported HTML Tags
HtmlTextBoxVarious formatting options are available and provide control over the HtmlTextBox text presentation:
- Font, color (
<font>), and size (relative size against the font size of the item). The default size value is
3out of the 1-7 range.
- Bold, Italic, Underline (
- Subscript, Superscript (
- HyperLink (
<a href target>).
- Lists (
- Text organization in paragraphs (
While the HtmlTextBox does not support the
img tags, you can use the native Telerik Reporting Table, Crrostab, and List report items instead of
table, and the PictureBox report item instead of
Supported CSS Attributes
When you import text that contains HTML markup, the data is always parsed by the HtmlTextBox first. Because only a subset of HTML tags is supported, the HTML that is shown in the rendered report may differ from your original HTML.
Also, according to the HTML specification and the general XML specification, the
> characters are considered as markup delimiters and you have to encode them so that they are treated as regular text. For example, you can escape the
& amp; entity. For more information, refer to the w3.org article.
Any other HTML markup tags will be ignored during the processing of the report. If the HTML represented by the expression in the HtmlTextBox is badly formatted, the HtmlTextBox will throw an exception. Note that all HTML tags are case-insensitive.
The HtmlTextBox supports the following CSS attributes for styling its text:
- (Specify it on a block item.)