none
Error when expression gets divided by zero RRS feed

Answers

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


    Please Dont forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question. Milan Das

    • Marked as answer by VarshaMishra Saturday, July 25, 2015 5:17 AM
    Saturday, July 25, 2015 5:16 AM