我想在水晶报告中显示数字列的总和,但请隐藏0。
尝试:
-
给出计数。需要总和。IIF ( ToNumber({Choice_.Choice1}) > 0 , true, false)
-
NOT(ISNULL({Choice_.Choice1}))
-
IF( ToNumber({Choice_.Choice1}) > 0) then ToNumber({Choice_.Choice1})
仍然显示" 0"。值
* IIF ( ToNumber({Choice_.Choice1}) > 0 , true, false) >> Gives Count. Need Sum
由于您的公式返回字符串因此,在报告中,您只会得到计数,因此没有总和。如果您需要总和,则返回号码。
* NOT(ISNULL({Choice_.Choice1}))
* IF( ToNumber({Choice_.Choice1}) > 0) then ToNumber({Choice_.Choice1})
不确定为什么您在上述代码上写
编辑-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
然后,您在错误的地方写了它,您需要在报告标题的专家的Supress部分中编写公式,而不是报告字段。
转到报告标头的supress部分。
Right click on report header --> section expert --? click x->2 of supress
和写入公式(如果数据在报告标头中,则适用于其他公式,在其中存在数据的部分)
),您的公式将为
ToNumber({Choice_.Choice1}) > 0 //Take care choice1 should always a numeric vallue else report throws exception