How to check if SSRS Textbox is empty

扶醉桌前 提交于 2019-12-06 18:43:28

问题


How do you check if a textbox is empty in SSRS 2008? I've tried this code and it doesn't work.

IIF(ReportItems!txtCountVolunter.Value = "", false, true)

回答1:


Try the following:

=IIF(Len(ReportItems!txtCountVolunteer.Value) <= 0, true, false) 



回答2:


You should use this expression

=IIF(IsNothing(Fields!UserEmail.Value) OR Fields!UserEmail.Value = "",
 "Empty", "Not Empty")

The first: IsNothing(Fields!UserEmail.Value) checks if the field value is NULL The second: Fields!UserEmail.Value = "" checks of the filed value is blank ""

So you need both of them in order to check if the value is either null or empty.




回答3:


Try the IsNothing function like this:

IIF(IsNothing(ReportItems!txtCountVolunter.Value), "empty", "not empty")




回答4:


Check for null

=IIF(IsNothing(ReportItems!txtCountVolunteer.Value),true, false) 



回答5:


For those who come from a .NET world and you want to check non-empty and say for argument sake want the value 0 instead of blank!

=IIf(String.IsNullOrEmpty(ReportItems!txtCountVolunteer.Value), 0, ReportItems!txtCountVolunteer.Value)


来源:https://stackoverflow.com/questions/12738569/how-to-check-if-ssrs-textbox-is-empty

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