Friday, September 14, 2018

Jasper server errors on evaluating parameters that are commented out

Jasper server might return error like this

org.postgresql.util.PSQLException: The column index is out of range: 15, number of columns: 14. at 
...
org.apache.commons.dbcp.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:104) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter(JRJdbcQueryExecuter.java:604) at

...
if there's a parameter in the comments of the report's query ($P{param} expression) as the server seems to try to evaluate those expression. The actual error might be different but watch out for parameter, field and variable expressions in the comments.