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

strip the special characters from dynamic columns with HTMLTextBox

3 Answers 190 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jonam
Top achievements
Rank 1
Jonam asked on 25 Nov 2010, 02:41 PM

textBoxTable = new Telerik.Reporting.HtmlTextBox();
                textBoxTable.Style.BorderColor.Default = Color.Black;
                textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                textBoxTable.Value = "=Fields." + dc.ColumnName;

i create dynamic columns with the code above. But when the value of a row has the '&' character it displays the error. "Error occured while processing HTMLTextBox". How can i avoid this error without changing the values that are stored in the database from & to &.

greetings Jonam

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 25 Nov 2010, 03:22 PM
Hello Jonam,

Your question has already been answered in the other forum thread you've posted to.

Sincerely yours,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
AkAlan
Top achievements
Rank 2
answered on 28 Feb 2011, 06:03 PM
I'm having the same issue. Could you at least add the referenced post to this one.
0
Steve
Telerik team
answered on 01 Mar 2011, 05:13 PM
Hello AkAlan,

This is expected behavior. As outlined in the HtmlTextBox help article, we expect valid XHTML, and the "&" character is considered special (markup delimiter), so it needs to be encoded in order to be treated as regular text (the "&" character can be escaped with the "&" entity). It is good idea to do this in your data, as otherwise you would have to parse the data in your code, which is not recommended. Check the XHTML Validation help article elaborates on how you can handle exceptions caused by invalid XHTML.

Best wishes,
Steve
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Jonam
Top achievements
Rank 1
Answers by
Steve
Telerik team
AkAlan
Top achievements
Rank 2
Share this question
or