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

HtML TEXT Box Control

5 Answers 630 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Farrukh
Top achievements
Rank 1
Farrukh asked on 19 Jan 2012, 07:23 AM
We are using HtmlTextbox for reporting english and arabic data because exporting to word file doesn't work fine with database column directly .Now porblem in htmltextbox is, if data have wild character like  (&, /,$ , ; ) it gives error "An error has accured while processing HtmlTextBox".Kindly gives us solution as soon as possible thanks.

5 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 19 Jan 2012, 09:26 AM
Hi Farrukh,

According to the HTML specification (and the general XML specification) the "&", "<" and ">" characters are considered special (markup delimiters), so they need to be encoded in order to be treated as regular text. For example the "&" character can be escaped with the "&amp;" entity. More information on the subject you can find in this w3.org article.

Kind regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Bob
Top achievements
Rank 1
answered on 03 Apr 2014, 09:28 PM
I have been having some issues with the "&" and the htmlTextBox. Until now I have been able to escape it with the "&amp;" by executing a "Replace("&",""&amp;") in the SQL code for the SqlDataSource SelectCommand. We now have to attach the same command to an Access 2007 database. Access does not support the remote execution of the "Replace" command so I can't escape it using SQL. How can I escape the command using the "Replace" command in the report expression?

The statement below does not work.

design view:
{Replace(Fields.CurrentAssee,"&","&amp;")}{Fields.incareOf}
{Fields.streetAddress}
{Fields.City}, {Fields.state}
{Fields.zip}

html View
{Replace(Fields.CurrentAssee,"&amp;","&amp;amp;")}{Fields.incareOf}<br />{Fields.streetAddress}<br />{Fields.City},&nbsp;{Fields.state} {Fields.zip}

Thanks,

bobn :>)
0
Stef
Telerik team
answered on 07 Apr 2014, 02:31 PM
Hi Bob,

At our side using the Replace Text function in the Html view of the HtmlTextBox works as expected:
the tested expression:
{Replace("test&test","&","&")}

You can also use a custom function to escape special characters.

If you need further help, feel free to open a support ticket and send us a sample report with your settings and test data to run it.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bob
Top achievements
Rank 1
answered on 07 Apr 2014, 08:58 PM
I see that you are referencing the HtmlTextbox from the "Design View". There is no need to escape "Test & Test" as the input as it translates the value as "Test &amp; Test" in the html view. Try data binding the value "Test & Test" and passing it into the textbox and then tell me how it works out. As far as custom functions go, I was never able to use a custom function, it reports and error "The expression contains undefined function call Replace().
{TAXI.Classes.ReportFunctions.Replace(Fields.CurrentAssee,"&", "&amp;")}{Fields.incareOf}
{Fields.streetAddress}
{Fields.City}, {Fields.state}
{Fields.zip}

Thanks, Bobn :>)
0
Accepted
Stef
Telerik team
answered on 10 Apr 2014, 05:17 PM
Hello,

You can find attached a sample report definition, illustrating our test to escape the & symbol in a text coming from the data.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Farrukh
Top achievements
Rank 1
Answers by
Steve
Telerik team
Bob
Top achievements
Rank 1
Stef
Telerik team
Share this question
or