Error when expression gets divided by zero
I am getting error when my expression is getting divided by zero.How can I solve it.
July 25th, 2015 1:13am

Please use  the below code in your report code.

Public Function Divider (ByVal Dividend As Double, ByVal Divisor As Double)
If IsNothing(Divisor) Or Divisor = 0
  Return 0
Else
  Return Dividend/Divisor
End If
End Function 

and use it in your expresion like below eg

=Code.Divider(Fields!FieldA.Value, Fields!FieldB.Value)

Free Windows Admin Tool Kit Click here and download it now
July 25th, 2015 1:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics