【发布时间】:2019-08-16 01:41:11
【问题描述】:
我在下面的 SSRS 表达式中使用。基本上计算基于 SSRS 报告中的两个文本字段,如下所示。我仍然会收到错误,以防万一
ReportItems!Amount6.Value 没有价值或记录。
=iif(reportitems!Amount.Value = 0 or reportitems!Amount6.Value = 0 or Len(reportitems!Amount.Value) <= 0 or Len(reportitems!Amount6.Value) <= 0, NOTHING, (ReportItems!Amount.Value - ReportItems!Amount6.Value) / ReportItems!Amount6.Value)
=iif(reportitems!Amount.Value = 0 or reportitems!Amount6.Value = 0 or Len(reportitems!Amount.Value) <= 0 or Len(reportitems!Amount6.Value) <= 0, NOTHING, (ReportItems!Amount.Value - ReportItems!Amount6.Value) / ReportItems!Amount6.Value)
【问题讨论】:
-
为什么不通过数据集而不是计算字段来做呢?
-
错误信息是什么?
-
我已经在数据集上做过这样的“isnull(Amount,0) Amount”。但还是报错
-
像这样给我“#Error”
-
我猜你需要确保
ReportItems!的大小写正确。 SSRS 可能对这样的小事很挑剔。您引用的每个报告项是使用多个字段计算得出的,还是您可以简单地将它们称为Fields!Amount.Value或从查询中调用它们的任何名称?