HtmlDecode in HTML Textbox throwing error for "&" and "&"

1 Answer 147 Views
DataSource SQL Expressions HTMLTextBox Report Designer (standalone)
Steve
Top achievements
Rank 1
Iron
Steve asked on 31 May 2023, 06:52 PM

I have an HTML Textbox in my report with the expression {HtmlDecode(Fields.RAW_HTML)} and it works in most cases EXCEPT

when the RAW_HTML field contains "&" in the literal string: ex) <span>Jack & Jill</span>

I have tried replacing "&" with "&amp;" on the SQL query, however i get the same error.

"An error ocurred while parsing EntityName"

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 05 Jun 2023, 09:11 AM

Hi Steve,

Thank you for the provided information!

Replacing the '&'  symbol with '&amp;' with the given span example worked locally. The reason for that approach not working in your scenario might be that you are retrieving a double-encoded string from the database, we recently had a case such as this.

If the problem is only with this symbol, you may use the Replace text function to fix the string, for example:

= Replace(HtmlDecode(Fields.RAW_HTML),"&", "&amp;")

If that does not help and you need further assistance, please try sending me some sample data to test locally. 

I will be looking forward to receiving an update from you.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
DataSource SQL Expressions HTMLTextBox Report Designer (standalone)
Asked by
Steve
Top achievements
Rank 1
Iron
Answers by
Dimitar
Telerik team
Share this question
or