Search code examples
c#asp.netrdlcssrs-2008-r2dynamic-rdlc-generation

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)))

Solution

  • Using IIf you have to remember that both side (TruePart and FalsePart) are always evaluated so dividing by 0 raise an #Error.

    You can use custom code (right click design surface outside report > Report Properties > Code) and replace IIf with an If/Then/Else.