How to check if SSRS Textbox is empty

2019-04-19 03: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)

5条回答
放荡不羁爱自由
2楼-- · 2019-04-19 03:52

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)
查看更多
疯言疯语
3楼-- · 2019-04-19 03:58

Try the following:

=IIF(Len(ReportItems!txtCountVolunteer.Value) <= 0, true, false) 
查看更多
甜甜的少女心
4楼-- · 2019-04-19 04:02

Check for null

=IIF(IsNothing(ReportItems!txtCountVolunteer.Value),true, false) 
查看更多
虎瘦雄心在
5楼-- · 2019-04-19 04:04

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.

查看更多
可以哭但决不认输i
6楼-- · 2019-04-19 04:14

Try the IsNothing function like this:

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

查看更多
登录 后发表回答