SSRS 2008 R2 如果为空则删除空格
我有一个简单的 SQL Server 2008 R2 报告,其中包含一个包含几个字段的文本框。如果字段的值为空,我想抑制该行。该表达式的语法是什么?
所以我的字段是...
Name
AddressLine1
AddressLine2
AddressLine3
CityStateZip
并且我有这样的表达式...
=First(Fields!AddressLine2.Value, "dsPersonData")
我正在尝试下面的表达式但出现错误
=IIF(Fields!AddressLine2.Value, "",True,False)
换句话说,如果该值是空字符串,我试图将可见性设置为 false 但我不确定语法是什么。
I have a simple SQL Server 2008 R2 report with a textbox containing a few fields. I want to suppress the line if the value of a field is null. What would be the syntax for the expression?
So my fields are...
Name
AddressLine1
AddressLine2
AddressLine3
CityStateZip
and I have expressions like this...
=First(Fields!AddressLine2.Value, "dsPersonData")
I was trying the expression below but getting errors
=IIF(Fields!AddressLine2.Value, "",True,False)
In other words I was trying to set the visibility to false if the value was an empty string but I'm not sure what the syntax would be.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以尝试
you can try
在 sql 查询中很容易做到这一点,例如:
在 SQL Server 中:
ISNULL(Name, '') as Name
ISNULL(AdressLine1, '') 作为 AdressLine1
ISNULL(AdressLine2, '') 作为 AdressLine2
ISNULL(AdressLine3, '') 作为 AdressLine3
ISNULL(CityStateZip, '') as CityStateZip
如果要将可见性设置为 false:
=IIF(First(Fields!AddressLine2.Value, "dsPersonData") = "",False,True)
Is easy to do this in the sql query, For example:
in SQL Server:
ISNULL(Name, '') as Name
ISNULL(AdressLine1, '') as AdressLine1
ISNULL(AdressLine2, '') as AdressLine2
ISNULL(AdressLine3, '') as AdressLine3
ISNULL(CityStateZip, '') as CityStateZip
and if you want to set the visibility to false:
=IIF(First(Fields!AddressLine2.Value, "dsPersonData") = "",False,True)