【问题标题】:#Error is showing when database field is empty SSRS 2005#Error 在数据库字段为空时显示 SSRS 2005
【发布时间】:2014-10-04 13:21:11
【问题描述】:

我的SSRS表达式之前是这样的:

=Fields!Reference.Value // This Reference.Value in DB is varchar type.

意思是,无论数据库表中的值是什么,我都能显示它。也就是说,例如 value 为 0 则可以显示 0,如果 value 为 1,则可以显示 1,如果 value 为空,则可以显示 empty。

现在,我被告知的情况是,当值为 0 时显示为空。这意味着在 0 或 Empty 的情况下,我必须显示 Empty。所以我添加了以下表达式:

=IIF(Fields!Reference.Value=0, " ",Fields!Reference.Value)

但是,在这种情况下,如果值为 0,我可以显示为空。问题是当有空的 DB 字段时,它会显示 #Error。如何纠正它?请帮忙。

【问题讨论】:

    标签: sql-server reporting-services expression reportingservices-2005


    【解决方案1】:
    =IIF(IsNothing(Fields!Reference.Value) OR Fields!Reference.Value = 0, " ",Fields!Reference.Value)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-21
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 2013-05-01
      • 1970-01-01
      相关资源
      最近更新 更多