IsNothing not working on empty value in report builder

為{幸葍}努か 提交于 2019-12-10 19:59:40

问题


I have an expression in a table that checks if there was a return value.

If the query returns empty or null I want to set the value to 0.

=IIF(IsNothing(Fields!DndCount.Value),0,Fields!DndCount.Value)

But if the query returns empty IsNothing() does not work.


回答1:


I have tried this code and it worked for me.

IIF(Sum(Fields!DndCount.Value)Is Nothing, "0", Sum(Fields!DndCount.Value))



回答2:


Alternative solution to avoid using expressions, change the cell format to #,##0 in properties. Easier then to pair it up with count or sum.




回答3:


Try this:

=IIF(Fields!DndCount.Value=0 OR 
IsNothing(Fields!DndCount.Value)=0 OR
Fields!DndCount.Value="null",0,Fields!DndCount.Value)



回答4:


Since IsNothing will return a True or False value you need to set your expression as:

=IIF(IsNothing(Field1) = True, 0, Field2)   

Hope it helps.




回答5:


You can also try to use the IsMissing expression of the field,

like this:

=IIF(Fields!Accounting_Amount.IsMissing, 0, Fields!Accounting_Amount.Value)


来源:https://stackoverflow.com/questions/17511151/isnothing-not-working-on-empty-value-in-report-builder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!