简体   繁体   English

SSRS表达式,用于在列值= 0时隐藏行

[英]SSRS Expression for hiding the row when a column value = 0

I'm attempting to hide a row based on a column having the value 0. The Quantity column is a decimal datatype. 我试图根据值为0的列隐藏行。“数量”列是十进制数据类型。

I'm trying =IIf(Fields!Quantity.Value = 0 True,False) in row visibility 我正在尝试在行可见性中=IIf(Fields!Quantity.Value = 0 True,False)

My error is: 我的错误是:

error: [BC30455] Argument not specified for parameter 'TruePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'. 错误:[BC30455]未为“公共函数IIf(作为布尔型表示,作为对象的TruePart作为对象,作为对象的FalsePart作为对象)”的参数“ TruePart”指定了参数。

class   |  Quantity | AcctV | ExtVal |
GENERAL |    20     |  49   |  980   |
RETAIL  |    0      |   0   |  0     |   <-- This should be invisible 

You are missing a comma after the zero 您在零后缺少逗号

=IIf(Fields!Quantity.Value = 0, True,False)

Actually you can simplify the whole thing and just use 实际上,您可以简化整个过程,而只需使用

=Fields!Quantity.Value = 0

as this will return true or false anyway. 因为无论如何它都会返回true或false。 No need for IIF 无需IIF

If all row datas are zero you can hide row group visibility expression. 如果所有行数据均为零,则可以隐藏行组可见性表达式。

=IIf((Sum(Fields!Data1.Value) = 0) AND (Sum(Fields!Data2.Value) = 0) AND (Sum(Fields!Data3.Value) = 0) AND (Sum(Fields!Data3.Value) = 0) AND (Sum(Fields!Data4.Value) = 0) AND (Sum(Fields!Data5.Value) = 0) AND (Sum(Fields!Data6.Value) = 0), True,False)

在此处输入图片说明

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM