
When using SRS to deliver reports derived from data entered through multiline text fields, SRS frequently returns non alphabetic characters like those returned below:
The following VB function removes unwanted HTML content from data retrieved from the Project Server Reporting database that is managed originally within a multiple-Line field on a Project Detail Page (PDP).\
- Start Microsoft Visual Studio (BIDS) and open your Report Project.
- Right-click on the report canvas and select “Report Properties”.
- Select the “Code” tab.
- Paste into the Code textbox the following code:
Public FUNCTION RemoveHtml(ByVal Text As String) AS String
IF Text IsNot Nothing Then
Dim objRegExp AS NEW System.Text.RegularExpressions.Regex(“<(.|\n)+?>”)
Text = Replace(Text,” ”, vbcrlf)
Text = Replace(Text,”'”, “‘”)
Text = Replace(Text,”&”, “&”)
Text = Replace(Text,”"”, “”””)
Text = Replace(Text,”<”, “<“)
Text = Replace(Text,”>”, “>”)
Text = Replace(Text,”©”, “”)
RETURN objRegExp.Replace(Text, “”)
END IF
END Function
- Click OK when done
- Now back within your report, right-click your form field that you need to remove HTML from and select “Expression”.
- Add the desired field from your dataset and then wrap it within the following function call.=code.RemoveHTML(Fields!Your_HTML_Content_Field.value)
