Starting in 6.8.02, nearly all Double
fields were converted to BigDecimal
fields in the database.
This can cause some issues for databases using these fields in unusual ways, but primarily, this change can stop reports and labels from running properly.
Error evaluating expression:
When running a report with the incorrect field class type, you may encounter this error:
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
The most common problematic fields are minElevation
and maxElevation
in the Locality table in the Specify Schema.
Below are instructions to resolve this error in Specify:
- Open the report that is reporting an error in SpiReport and expand the fields list.
In this instance, I am selecting Max_Elevation.
- Change the Field Class Type to
java.math.BigDecimal
- Save your report or label. Refresh the reports in Specify 6 and you should no longer have any issue!
You can repeat this process for each problem field and the report will run correctly as it did before the 6.8.02 schema update!
Advanced: If you quickly want to discover if any of your reports/labels are affected, you can run this command on your database:
SELECT spar.Name, spard.data
FROM spappresource spar
JOIN spappresourcedata spard ON spar.SpAppResourceID = spard.SpAppResourceID
WHERE spar.SpAppResourceID IN (
SELECT AppResourceID FROM spreport
)
AND spard.data LIKE '%java.lang.Double%'
;