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

x
?
Solved

Trying to toggle tablix visibility based on expression

Posted on 2011-04-25
2
Medium Priority
?
1,303 Views
Last Modified: 2012-05-11
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!
0
Comment
Question by:kalittaair
2 Comments
 
LVL 27

Accepted Solution

by:
planocz earned 2000 total points
ID: 35461251
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
 

Author Closing Comment

by:kalittaair
ID: 35484172
Thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code started out as a fix for a customer that had incoming data that was hunderds of numbers and words long that was to fit in one column. The problem was that the customer did not want to split words or numbers when wrapping in the column. …
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question