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

What is the best way to fix this problem?

1 Answer 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 07 Apr 2011, 03:19 PM
Im building a survey system and have stumbled upon a problem...

It's a web project where schools log on to answer some forms rendered by the system. The forms are built of question/answer. The answer input is of type telerik:RadEditor. Then for the person responsible for the form I am using telerik reporting to report every schools answer in each type of form. Now the answer can be anything from a simple name to complex tables and lists.

Now when I wan't to report this i want to use the same control for both the simple text and the big tables.

I have attached a file to display the general idea.

= Fields.strValue is the html part.

Now there are no problems displaying text/lists and so on. But when it comes to tables telerik reportings htmlbox isnt supporting html other that text formatting.

So how should I make my reporting display the tables as they are in html?

Keeping in mind that sometimes there are tables, and sometimes there are not!

Anders

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 12 Apr 2011, 02:06 PM
Hello Anders,

There are some limitations when working with HTML, which I will explain here.

Telerik Reporting (TR) is a server solution, which is intended to process and render data, rather than text (be it plain text or richly-formatted text). TR supports several export formats (one of which HTML), but they are all geared towards exporting tabular data  and charts, rather than richly-formatted text.

This works in the following way: the reporting engine serves the report content in a predefined format to show it under the specific platform; for example, if you are using TR in a ASP.NET application, it uses a stream to serve HTML to the browser. It is important to note here that the report rendering happens before the content is served to the browser, i.e. the browser has nothing to do with the report rendering. The browser just shows the HTML, which has already been prepared by the report rendering.
 
If TR is to serve all HTML tags and CSS attributes (be them produced by Microsoft Word, RadEditor for ASP.NET, or RadRichTextBox for Silverlight), we will need to develop a HTML engine which to render this HTML before it hits the client. 

This is the reason why TR renders a small subset of HTML tags and CSS attributes, all of which have been written by our developers to support the most common text formatting options:

  • Supported HTML tags:
        * Font, size (relative size against the font size of the item, default is 3 (1-7)), color (<FONT>)
        * Bold, Italic, Underline (<STRONG>,<B>, <EM>, <I>, <U>)
        * HyperLink (<A href target>)
        * Lists (<OL>, <UL>, <LI>)
        * Organize the text in paragraphs (<DIV>, <SPAN>,<P>, <BR>, <CENTER>)
  • Supported css attributes:
        * background-color
        * border-color, border-width, border-style
        * text-align (center, left and right only), text-indent
        * font-family, font-size, font-weight
        * padding, padding-bottom, padding-top, padding-right, padding-left
        * color
I would like once again to stress that TR is supposed to render exclusively data and charts, rather than text. The rich-text formatting options are available for the sole purpose of styling labels and headers.

The solution is to use content filters that will remove all HTML tags except those understood by the Reporting export engine. This is done by using Regular Expressions. You can do this either before saving Word's HTML in the data base, or before passing the HTML to TR - it is up to you.

Kind regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Anders
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or