Invalid characters in my SSRS report

I am getting "<" and >" being displayed in my report. How can I get rid of these characters?
g46905Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
planoczConnect With a Mentor Commented:
these symbols are comes from a internet display, either from the in coming data that is being stored in the sql database or isomehow in your report.
You might try this in the visitly hide properties of the comment box....
=IF (Trim(Fields!ows_COMMENTS.Value) = "",True,False)
0
 
BostonMACommented:
Can you provide more detail such as a screenshot or what sql is used to retreive these fields?  
0
 
g46905Author Commented:
Below is the field that I am using for the field. Can I use trim functionality and replace the unvalid characters?
Fields!ows_COMMENTS.Value
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
planoczCommented:
Is this info that you are retreiving from the sql table from a html or asp page?
0
 
g46905Author Commented:
Genious - I am not sure what you are asking. I am retreiving this information from SQL database and displaying it onto my SSRS report. Can you please elaborate what you are asking. Thanks for your help!

0
 
g46905Author Commented:
planocz - Unfortunately. that did not work....
0
 
g46905Author Commented:
This is what I see for one of the text fields in the reports.....

<html><body><font color="#000080"><b>Susan <sms>, 5/10/2007: </b></font> Per a message from John today, "the headings will remain as is."</body></html>
0
 
Alfred A.Commented:
You can try doing this:

Replace(Replace(Fields!ows_COMMENTS.Value,"&lt;","<"),"&gt;",">")
0
 
Alfred A.Commented:
Or, with ampersand and quotes

Replace(Replace(Replace(Replace(Fields!ows_COMMENTS.Value,"&lt;","<"),"&gt;",">"),"&amp;","&"),"quot;","""")
0
 
planoczConnect With a Mentor Commented:
Ok try this in your code tab properties box
  Public Function CleanHtml(ByVal theText As String) As String
        theText = System.Text.RegularExpressions.Regex.Replace(theText, "b&gt;|&lt;|html|&gt;|&lt;|body|/body&gt;|gt;|&lt;|lt;|font color=|#[0-9]{1,6}|&quot;|quot;|&amp;|sms&amp;", "")
        theText = System.Text.RegularExpressions.Regex.Replace(theText, "/b&gt;|/font|/+[a-z]{1,4}", "")
        theText = System.Text.RegularExpressions.Regex.Replace(theText, "\.+/", ".")
        Return theText
    End Function

On the report use this type of code in the textbox for each data that you want to change.
=code.CleanHtml(fields!ows_COMMENTS.Value)

Also if I missed a char you can adjust it in the function code.
0
 
GSGDBACommented:
HI,
If you have < and > signs in your code.
Try to remove them

see the below link what &lt;" and &gt;  means
http://www.velocityreviews.com/forums/t160903-what-are-these-characters-and-lt.html
0
 
g46905Author Commented:
Alfred1 - By using your function above, I am able to convery &lt and &gt to '<' and '>'. Unfortunately, now I see below happening.....any suggestions to get rid of this issue??

<html><body><font
color=&quot;#000080&quot;><b>Lisa Jones &amp;lt;lisa&amp;gt;,5/10/2007: </b></font>message from David today,&amp;quot;the heading will remain as is.&amp;quot;</body></html>

0
 
g46905Author Commented:
planocz: - How can I get to "code tab properties box" ?
0
 
planoczCommented:
should be on the body of the report just right click and view the window then click on the code tab and enter the code
0
 
Alfred A.Commented:
Try this one:

Replace(Replace(Replace(Replace(Fields!ows_COMMENTS.Value,"&lt;","<"),"&gt;",">"),"&amp;quot;",""""),"&quot;","""")
0
All Courses

From novice to tech pro — start learning today.