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

HTML as plain text in report?

1 Answer 145 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John Hughes
Top achievements
Rank 1
John Hughes asked on 26 Jan 2011, 09:02 PM
I didn't find anything in the forums that seems to match what I am trying to do.  In our web application we are allowing the user to enter HTML tags, scripts, etc. into text entry widgets and we handle it as plain text.  However, this is causing me a problem when I get to the reports.

Project Name              Job Name            #Contractors
-----------------------------------------------------------------
<br>                          <p>                         10



This is how I want the report to look on the screen and when exported to PDF and CSV.  We are storing the text in our DB as HTML Encoded data.    If I don't decode the strings when they are sent to the report, I see what I want on the screen, but the exported formats show:


Project Name              Job Name               #Contractors
-------------------------------------------------------------------
&lt;br;&gt;                   &lt;p;&gt                   10



Now conversely, if I decode the strings before sending them to the report, I see this on the screen.

Project Name              Job Name               #Contractors
-------------------------------------------------------------------
                                                                   10


I see this in the exported formats (PDF/CSV):

Project Name              Job Name               #Contractors
-------------------------------------------------------------------
<br>                             <p>                        10


Is there any way to get everything to be consistent and show what I want in all cases?  Maybe some kind of escaping technique for the strings?

Thanks,

John

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Jan 2011, 10:18 AM
Hello John,

Your question has already been answered in the other thread you've opened. Here is our answer:

"Currently in order to handle such scenario you should use the approach from this KB article: Handle html in reports when you’re in the context of a web page only. Namely check what is the format you're into and alter the data accordingly for the HTML and MHTML.
The current behavior is left from the time we did not have HtmlTextBox and we would discuss whether it has to be changed."


We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding.

All the best,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
John Hughes
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or