Trying to toggle tablix visibility based on expression

Experts,

Using SSRS 2008.

I'm trying to toggle the visibility of a tablix based on whether or not a piece of data is contained within any one of 9 fields returned by a proc. the piece of data is "Change: ".

The function below always returns "True" even if one of the IF statements should resolve to true (thus returning false and displaying the tablix).

Here is my custom code:
Public Function ShowMore(ByVal sData As String, ByVal sData2 As String, ByVal sData3 As String, ByVal sData4 As String, ByVal sData5 As String, ByVal sData6 As String, ByVal sData7 As String, ByVal sData8 As String, ByVal sData9 As String) As Boolean
If sData.Contains("Change: ") = True Then
	Return False
End If
If sData2.Contains("Change: ") = True Then
	Return False
End If
If sData3.Contains("Change: ") = True Then
	Return False
End If
If sData4.Contains("Change: ") = True Then
	Return False
End If
If sData5.Contains("Change: ") = True Then
	Return False
End If
If sData6.Contains("Change: ") = True Then
	Return False
End If
If sData7.Contains("Change: ") = True Then
	Return False
End If
If sData8.Contains("Change: ") = True Then
	Return False
End If
If sData9.Contains("Change: ") = True Then
	Return False
End If
Return True
End Function

Open in new window


And here is my calling expression in the tablix visibiliy area:
=Code.ShowMore(Fields!LatitudeDegrees.Value, Fields!LatitudeMinutes.Value, Fields!LatitudeSeconds.Value, Fields!OfEquator.Value, Fields!LongitudeDegrees.Value, Fields!LongitudeMinutes.Value, Fields!LongitudeSeconds.Value, Fields!OfGreenwich.Value, Fields!FIR.Value)

Open in new window

Any idea what I'm doing wrong?

Thanks in advance!
kalittaairAsked:
Who is Participating?
 
planoczConnect With a Mentor Commented:
This is all you need for your behind code.

  Public Function ShowMore(ByVal Input As String) As Boolean
        Input = Input.ToLower
        If Input.Contains("change:") = True Then
            Return False
        Else
            Return True
        End If
        Return Nothing
    End Function

Place this code in each of your textboxes or cells that you are checking.
=Code.ShowMore(Fields!LatitudeDegrees.Value)
0
 
kalittaairAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.