This is a migrated thread and some comments may be shown as answers.

htmltextbox not rendering with styles

1 Answer 275 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 03 Feb 2011, 06:21 PM
I've got a form letter/report that is using an htmltextbox for the main body of the letter. It has a few paragraphs using just <p> tags and a couple of ordered lists, <ol>. The report looks fine when I preview it in the designer, but when I view it in the html previewer or on a web page with the ReportViewer the styling for the paragraphs don't appear. Mainly there's no spacing between the paragraphs. If I print or export to pdf the spacing is there. I also have a style on the ordered list, style="list-style-type: lower-alpha", which works in the editor but not anywhere else.

Not sure how to figure this out, its a very simple report. All help is appreciated.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 04 Feb 2011, 06:37 PM
Hi Tim,

Only a limited list of tags and styles are supported by the HTMLTextBox item. Check out HtmlTextBox item help article, you will find the list of supported html tags and style attributes. As stated in the same article, the purpose of the HtmlTextBox item is to allow rendering of formatted text using HTML - it is not intended to cover the whole HTML/CSS specification. The item may be referred to as a TextBox with the capability to render differently formatted chunks of text.

Solution
The solution to avoid unsupported HTML is to limit the HTML formatting options (by limiting the options from the entry tool for the html database field). If this tool is our RadEditor then we can guide you on how to accomplish that. Apart from limiting the formatting options, you will also need to prohibit your users to paste richly formatted content (from Word for example) by allowing plain text only (RadEditor can automatically do this for you by stripping all HTML tags), because even if you limit the toolbar to certain actions only, pasting rich-text will still be available by default. More information is available in the Using HTML from Telerik RadEditor

Hope this information helps.

Best wishes,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or