SSRS - 检查数据是否为空
我的报告中有以下表述。
=FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3)
现在,当数据集为空时,“Fields!Reading.Value”变为空,并且找到其最大值是无效的。如何检查整列是否为空?
我尝试了以下方法,但没有成功。
=iif(IsNothing(Fields!.Reading.Value),"",FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3))
但我仍然在报告中收到#Error。我还查看了 链接,但无法获得从中得到线索。我想在报告级别处理它。
I've the following expression in my report.
=FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3)
Now when the dataset is empty 'Fields!Reading.Value' becomes empty and finding their maximum is invalid. How can i check if the entire column is empty?
I tried the following with no luck.
=iif(IsNothing(Fields!.Reading.Value),"",FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3))
But still i'm getting #Error in the report. I also checked out link and was not able to get a clue from it. I want to handle it in the report level.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这样
try like this
或者在 SQL 查询中使用 IsNull 或 Coalesce (SQL Server) 包装该字段。
无论哪种方式都有效,我喜欢将该逻辑放入查询中,这样报告就必须做更少的事情。
Or in your SQL query wrap that field with IsNull or Coalesce (SQL Server).
Either way works, I like to put that logic in the query so the report has to do less.