You didn't explain the issue very well but I can see what the issue is, just from the expression. With IIF
statements, the entire statement is evaluated as soon as the cell is reached in the execution. This means that no matter how you try to avoid the divide by zero error in this expression, it will still evaluate the false condition and generate the error. I'm going to borrow some custom code from this answer to give you the solution.
Public Function Divide (ByVal Dividend As Double, ByVal Divisor As Double)
If IsNothing(Divisor) Or Divisor = 0
Return 0
Else
Return Dividend/Divisor
End If
End Function
To add this to your code, right click outside of the report in the designer window and go to Report Properties
. Click the Code tab and enter the previous code into the editor. Then, to call the code, you'll use the following expression.
=Code.Divide(Sum(Fields!CONTINUINGSTUDENTCOUNT.Value), Sum(Fields!STUDENTCOUNT.Value))