Reputation: 325
in my SSRS from dataset I get a column called TargetValues.
I need to display a textbox (Seting up the visbility rule) if I have at least one value (Not Null) for this column.
Is there any way to browse through the list and check if I have at least one not null value?
My dataset has 3 columns, Id - indicating the id of the row(int), ActualValue (int) and Target Value (int)
example 1: In this case I need to show the text box
Id ActaulValue TargetValue
example 2: In this case I need to hide the text box
Id ActaulValue TargetValue
Upvotes: 0
Views: 1502
Reputation: 2490
Set the below expression in the visibility property of the textbox after making it Show or Hide based on an expression -
=IIF(IIF( MAX( iif( IsNothing(Fields!TargetValues.Value ), -1, Fields!TargetValues.Value ), "give your dataset name" ) = -1, "Null Values", FormatNumber( MAX( iif( IsNothing(Fields!TargetValues.Value ), -1, Fields!TargetValues.Value ), "give your dataset name"),0)) = "Null Values", TRUE, FALSE)
Edit - Works fine for me, see the screen shot for reference.
Upvotes: 0
Reputation: 1336
Do you require null in your TargetValues? What is the min of the field?
I would look at trying to manipulate the query to make the logic for hiding the text box simpler.
For instance if you won't have negative numbers make the nulls 0 and test the Min() for 0 and use that to show/hide.
Like =IFF(Min(Fields!TargetValues.Value) = 0,TRUE,FALSE)
Also =IFF(IsNothing(Sum(Fields!TargetValues.Value)),TRUE,FALSE) might work
Upvotes: 1