Hi @Jannette Jones ,
You can add a function to your report code that handles the divide by zero condition, this makes it a bit easier to implement in multiple cells(Note:This solution also applies to reportitems), e.g.
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
You can then call this in a cell like so:
=Code.Divider(Fields!FieldA.Value, Fields!FieldB.Value)
Here is my test:
Design:
Preview:
Then we test the ReportItems with custom code:
Using Report Items:
Preview again:
Best Regards,
Joy
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.