Reporting Services: Value Either too Large or too Small for a Decimal

I have seen a few reports recently that have been upgraded from SSRS 2005 to SSRS 2008 where a ‘Value either too Large or too small for a decimal’ appears in the chart under certain circumstances.  This typically manifest itself when an expression in the data series for the chart looks something like that below:

=IIf(Fields!ISMONEYAMOUNTSW.Value = 0 and Fields!TIMEINSECONDS.Value > 0 , 
    Iif(Fields!ISMONEYAMOUNTSW.Value = 1 and Fields!TOTALAMOUNT.Value > 0,

Notice the empty string in the last expression as part of the FalsePart of the IIf expression.  This also happens if ‘Nothing’ is used.  These values, “” or ‘Nothing’, don’t evaluate to decimals in this case and the rendering engine has trouble converting them.  In the previous version I imagine this was ignored.  In SQL Reporting Services 2008 the value attempts to convert to the decimal type unsuccessfully.  The fix is simply to change the expression to a ‘0’ so that it is evaluated properly as shown below.

=Iif(Fields!ISMONEYAMOUNTSW.Value = 0 And Fields!TIMEINSECONDS.Value > 0 , 
    Iif(Fields!ISMONEYAMOUNTSW.Value = 1 And Fields!TOTALAMOUNT.Value > 0,
Comments (2)
  1. R. Schreurs says:

    Thank you for reporting the cause you found. This was the clue I needed. In my case, I was receiving null values in the query, which I attempted to use as the series data in a column chart.

    The queickest fix was to modify the Series Data property from:



    =IIf(IsNothing(Fields!percentage.Value), 0, Fields!percentage.Value).

Comments are closed.

Skip to main content