Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

i am trying to hide rdlc report columns whose values are zeros all through, that is, if some cells have values within the column, it shouldn't hide using the column visibility property. this is my code:

=iif(Fields!HousingAllowance.Value > 0,false,true)

this seems to work, but there is an issue with the above formula, it hides column if the first cell value for the column is zero, even when the column contains others values, i also tried this:

=SUM(iif(Fields!HousingAllowance.Value > 0,false,true))

but no success, i want to be able to sum the column values, if the result is zero, it should hide, else it show.

What I have tried:

=SUM(iif(Fields!HousingAllowance.Value > 0,false,true))

also tried this:

=iif(Fields!HousingAllowance.Value > 0,false,true)
Posted
Updated 4-Apr-17 4:43am
Comments
CHill60 4-Apr-17 7:58am    
How do you populate the report in the first place?
Richard Deeming 4-Apr-17 8:22am    
Assuming you don't have any negative values, how about moving the Sum inside the IIF:
=IIF(Sum(Fields!HousingAllowance.Value) > 0, False, True)
Uwakpeter 4-Apr-17 10:41am    
Thanks Richard Deeming, it works.
Richard Deeming 4-Apr-17 10:43am    
OK, I'll post it as a solution then. :)

1 solution

As discussed in the comments, the Sum needs to be inside the IIF:
=IIF(Sum(Fields!HousingAllowance.Value) > 0, False, True)

(Obviously, if HousingAllowance contained any negative values, this would not work; you'd need to test the sum of the absolute values instead.)
 
Share this answer
 
v2
Comments
Uwakpeter 6-Apr-17 1:32am    
yes, i have handled that. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900