这个 rdlc 表达式有什么问题。当差异为零时,它会抛出错误

What is wrong in this rdlc expression. When ever the difference is zero it throws error

=iif(Sum(Fields!ClsRead.Value)-Sum(Fields!OpnRead.Value)=0,"NO HSD Supplied",sum(Fields!HSDIssued.Value)/(Sum(Fields!ClsRead.Value)-Sum(Fields!OpnRead.Value)))

使用 IIf 你必须记住两边(TruePartFalsePart)总是被评估所以除以 0 会产生 #Error.

您可以使用 custom code(右键单击报告外的设计图面 > Report Properties > Code)并将 IIf 替换为 If/Then/Else