I am doing computations on that data that will result in #Error at times. The underlying cause is a divide by zero. I could jump through the necessary work arounds to avoid the divide by zero, but it might be simplier to mask the #Error text and show a blank cell. Is it possible to hide the #Error and just display nothing?
Edit
The expression for the text might display #Error is something along these lines:
Fields!Field1.Value / Fields!ValueThatMightBeZero.Value
I could work around this with some ugly checking, but it might be easier to just catch the #Error. (A straight iif
check around the express doesn't work because SSRS evaluates both the true and false clauses first; if it gets a divide by zero on either clause, it will return #Error, even if that clause wouldn't have been used).
To hide static columns in a table, matrix, or list. In Design view, select the table, matrix, or list to display the row and column handles. Right-click the column handle, and then click Column Visibility. In the Column Visibility dialog box, follow steps 3 and 4 in the first procedure.
Click on the expression button fx . Enter the expression =IIf(CountRows("Items") = 0 , True, False) . Note that this expression is to hide the Textbox (Hidden). Click OK twice to close the dialogs.
Denying Access to My Reports You can prevent users from accessing My Reports by: Disabling My Reports on the Site Settings page. For more information, see Enable and Disable My Reports.
Change the font to be the color of the background if Fields!Value_Denominator.Value=0
and you won't see the error message.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With