• I'm new to SSRS and I'm having trouble understanding how to use this script. Can you please assist?

    I've entered the following in the report perameters - code window.

    Public Function CalcRatio(ByVal Numerator As Object, ByVal Denominator As object, ByVal DivZeroDefault As Object) As Object

    If Denominator <> 0 Then

    Return Numerator/Denominator

    Else

    Return DivZeroDefault

    End If

    End Function

    I then entered the following in the expression of the textbox.

    =code.CalcRatio((sum(Fields!total.Value)+(Fields!Adjustment.Value))/Fields!Goal.Value, 0)

    but I get the following error.

    The Value expression for the textbox ‘textbox28’ contains an error: [BC30455] Argument not specified for parameter 'DivZeroDefault' of 'Public Function CalcRatio(Numerator As Object, Denominator As Object, DivZeroDefault As Object) As Object'.

    What am I doing wrong?

    Thanks in advance for any help you may be able to provide.

    Regards,

    Missa