SSRS hide #Error displayed in cell

Change the font to be the color of the background if Fields!Value_Denominator.Value=0 and you won't see the error message.


It is ugly but here is a way I've found to make it work in the expression and without the custom function.

You have to check in the denominator too and substitute a non-zero divisor there so that divide by 0 never happens (even though we'd like the first half of the IIF to short circuit it and not get there at all): I use 1.
Of course this will then give an incorrect value but then I keep the outer IIF to show whatever I want when the denominator is 0 (I show 0 in my example).

=IIF(Fields!Value_Denominator.Value=0, 0, Fields!Value_Numerator.Value/IIF(Fields!Value_Denominator.Value=0,1,Fields!Value_Denominator.Value))

There is an IsError function, but it won't reduce the code you need to handle this. If you don't like the usual iif work arounds, then I think you need to use your own embedded code in the report. In that code you can have a try catch handler. Create a function that you can call with =Code.MyDivider(Fields!Field1.Value , Fields!ValueThatMightBeZero.Value)

Public Function MyDivider(top As Double, bottom As Double) As Double
    If top = 0 Then Return 0
    If bottom = 0 Then Return 0
    Return top / bottom
End Function