如何从rdlc报告中隐藏包含零的列 [英] How do I hide columns containing zeros all through from rdlc report
问题描述
大家好,
i我试图隐藏rdlc报告列,其值全部为零,也就是说,如果某些单元格中的值有列,则不应该不要使用列可见性属性隐藏。这是我的代码:
= iif(Fields!HousingAllowance.Value> 0,false,true)
这似乎有效,但是上面的公式存在问题,如果列的第一个单元格值为零,它会隐藏列,即使列包含其他值,我也试过这个:
= SUM(iif(Fields!HousingAllowance.Value> 0,false,true))
但没有成功,我希望能够对列值求和,如果结果为零,它应该隐藏,否则显示。
我尝试过:
= SUM(iif(Fields!HousingAllowance.Value> 0,false,true))
也试过这个:
= iif(Fields!HousingAllowance.Value> 0,false,true)
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)
推荐答案
正如评论中所讨论的,Sum
需要在IIF
内:
As discussed in the comments, theSum
needs to be inside theIIF
:
=IIF(Sum(Fields!HousingAllowance.Value) > 0, False, True)
(显然,如果 HousingAllowance
包含任何负值,这将无效;你需要测试绝对值的总和。)
(Obviously, if HousingAllowance
contained any negative values, this would not work; you'd need to test the sum of the absolute values instead.)
这篇关于如何从rdlc报告中隐藏包含零的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!