Another thing I remembered today, is that I rarely use UCase(Fields!Something.Value)
in my reports, because prior to 2008 SP1 or SP2 (I forget which), if you called that with a Nothing, it would return a small square character on your reports. If you instead used Fields!Something.Value.ToUpper()
you'd get an error or a warning if it was a Nothing, too.
You could wrap everything in an:
=IIf(Fields!Something.Value Is Nothing, "", UCase(Fields!Something.Value)
But who wants to do that all the time? So I wrote a little function to do it instead: NUCase.
Public Shared Function NUCase(ByVal value As String) As String
If value Is Nothing Then
Return ""
Else
Return UCase(value)
End If
End Function
You could, alternately, return a Nothing instead, but in most cases I actually want an empty string. Anyhow, then it's just a matter of using this instead of UCase:
=Code.NUCase(Fields!Something.Value)