SSRS function returns #Error if value of field is null

Posted by jen-fields on Stack Overflow See other posts from Stack Overflow or by jen-fields
Published on 2010-03-22T21:29:03Z Indexed on 2010/03/22 21:31 UTC
Read the original article Hit count: 387

Filed under:
|

Thanks in advance for any and all assistance.

My code is:

Public Function StripHTML(value As String) As String Return System.Text.RegularExpressions.Regex.Replace(value, "<(.|\n)*?>", "") End Function

Then I call the function from a textbox. This works great unless there are nulls in the dataset. I tried to compensate for the nulls, but the RDLC file generates an error message that it can't display the subreport.

Public Function StripHTML(value As String) As String if isnothing(value) then return value else Return System.Text.RegularExpressions.Regex.Replace(value, "<(.|\n)*?>", "") end if End Function

I also tried to tell it to return " " if null.

I had no luck...

Any ideas? and thanks again.

© Stack Overflow or respective owner

Related posts about ssrs

Related posts about error