UltraByte Posted November 5, 2007 Share Posted November 5, 2007 Hi, I have a problem with the following expression: $V{PAGE_NUMBER}+(Integer)($P{REPORT_PARAMETERS_MAP}.get("param1")) it is a simple sum in an integer variable, but it gives this error Code:net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions classfile: 1. The operator + is undefined for the argument type (s) java.lang.Integer, java.lang.Integer value = (java.lang.Integer)(((java.lang.Integer)variable_PAGE_NUMBER.getValue())+ (Integer)(((java.util.Map)parameter_REPORT_PARAMETERS_MAP.getValue()).get("param1"))); can anyone help me ? thanks. Post edited by: UltraByte, at: 2007/11/05 10:46Post edited by: UltraByte, at: 2007/11/05 10:48 Link to comment Share on other sites More sharing options...
Pedja Posted November 5, 2007 Share Posted November 5, 2007 You can do this by converting Integer to BigDecimal (maybe first Integer to String, and then String to BigDecimal), and then use BigDecimal.add() method. I know this is very dirty, but it works and I don't know any other way :) You could use something like (new BigDecimal($V{PAGE_NUMBER}.toString())).add(new BigDecimal($P{REPORT_PARAMETERS_MAP}.get("param1").toString())) I know it's ugly. Pedja Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now