If you have an expression that results in division by zero of RTC report layout, then the result will show as #Error. You can write a VB function to avoid this issue. So follow the below steps.
- First, you must write the following function in the RTC report. Open the report layout and go to the Code section of report properties, then add the following function in the Code section.
Public Shared Function DivideByValue(ByVal DivValue As Decimal, ByVal DivByValue As Decimal) As Decimal If DivByValue = 0 Then Return 0 End If Return (DivValue / DivByValue) End Function
- After creating the above function you can call it in the expression as you need. The following example will show, how to call this function in the expression of report layout.
Visit the previous tutorial about, how to convert Decimal to Text with rounding decimal places & thousand separators.