Reputation: 8762
Is it possible to test for white space in SSRS? I have some text boxes that the user can type some text into. It is leaving some white spaces sometimes and I have some conditions that test for the length of the string. I wonder if there's an easy way to test for that. tabs, spaces etc.
the text that I get contains HTML markup that I get from the user using and HTML editor. This text can contain HTML tags and sometimes whitespaces between them. I have some ReExp that gets rid of all the HTML tags but it leaves behind the white spaces that might be there. I want to remove them too
Ex.
"<p> </p><br/>"
Result after the RegEx processing
" "
Upvotes: 1
Views: 22288
Reputation: 63709
It's a little hard to see exactly what you're trying to accomplish. I'm assuming you're trying to get rid of excess (but not all) space characters.
Option 1: Regex
Do it in the regular expression. If you're using regexes to strip the tags, why not fix whitespace issues there as well? Remember though, people who try to solve one problem with regexes often end up with two problems ;-)
Option 2: Expressions
Use the Visual Basic functions in an expression when rendering a value in a textbox. Specifically trim and replace come to mind. Something along these lines:
=Trim(Replace(Fields!SomFieldName.Value, " ", " "))
' number of spaces >> 02 1
This can also be done in the query with SQL, I suppose.
Option 3: Placeholder + HTML
Use a placeholder and actually just render the html in the report. See this msdn article for info. I'm not sure which html tags are supported though.
Upvotes: 4