[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 706
  • Last Modified:

HTML

SSRS 2005
I have a text field that contains html.
I need to strip it out

I found this code, but it dosent work

=System.Text.RegularExpressions.Regex.Replace(Fields!MyFieldName.Value,@"<(.|\n)*?>",string.Empty)

the error I get is
"The Value expression for the textbox text contains error [BC300037] Character is not valid."

tia
0
fundsf
Asked:
fundsf
  • 5
  • 3
  • 2
1 Solution
 
James MurrellProduct SpecialistCommented:
0
 
jgvCommented:
The error is because of the @ symbol outside of the double quotes. You also need to enclose the characters being stripped out with square brackets. The corrected expression would look like this:
=System.Text.RegularExpressions.Regex.Replace(Fields!MyFieldName.Value,"[<(.|\n)*?>]",string.Empty)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
fundsfAuthor Commented:
jgv:
This is the error that I get when I add the expression
"Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specific set scope."

fyi it points to Replace as an issue in the editor
0
 
jgvCommented:
Don't worry about the syntax check on Replace; it does work. Your other problem is related to referencing a field that is not available ("out of scope"). Do you have the expression in a Table?
0
 
fundsfAuthor Commented:
Yes, Its in a table.
A group header
0
 
jgvCommented:
Is the field that you are referencing in the expression part of the dataset that the Table is linked to?

Did you create the table group using the same field being referenced in the expression or would the field in the expression be part of the group details?
0
 
fundsfAuthor Commented:
jgv:

Is the field that you are referencing in the expression part of the dataset that the Table is linked to?
--Yes

Did you create the table group using the same field being referenced in the expression or would the field in the expression be part of the group details?
---The Group that I created is not based on the field I need the HTML stripped

0
 
jgvCommented:
It's a bit difficult to troubeshoot this without seeing the report and how you have it setup.

Try changing the expression to this and seeing if it helps:
=System.Text.RegularExpressions.Regex.Replace(First(Fields!MyFieldName.Value),"[<(.|\n)*?>]",string.Empty)
0
 
jgvCommented:
This was still in the troubleshooting phase so there's no specific answer posted. The last suggestion I gave may have worked, but without any feedback there's no way to know. If fundsf does not follow up then I'd say split the points between cs97jjm3 and myself for making the attempt; final decision is yours.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now