sbced Posted January 31, 2011 Share Posted January 31, 2011 I'm using Jasperserver 3.7.1 and iReport 4.0.0On IReport I've 2 fields <field name="RBA" class="java.math.BigDecimal"/> <field name="MAV" class="java.math.BigDecimal"/> and I'm trying to display a field with the sum <textField pattern="#,##0;-#,##0"> <reportElement x="99" y="638" width="68" height="20"/> <box rightPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="1.0"/> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="7"/> </textElement> <textFieldExpression class="java.lang.Double"><![CDATA[$F{RBA}.doubleValue()+$F{MAV}.doubleValue()]]></textFieldExpression> </textField> On iReport I can compile and preview: all ok.But on Jaspersever called via browserhttp://xxxxx:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Apex/SK_CLIENTE_FG&output=pdfI've he error:Error Trace: com.jaspersoft.jasperserver.api.JSExceptionWrapper: Errors were encountered when compiling report expressions class file: 1. Cannot cast from double to Double value = (java.lang.Double)(((java.math.BigDecimal)field_RBA.getValue()).doubleValue()+((java.math.BigDecimal)field_MAV.getValue()).doubleValue()); //$JR_EXPR_ID=88$ <---------------------------------------------------------------------------------------------------------------------------------------> 2. Cannot cast from double to Double value = (java.lang.Double)(((java.math.BigDecimal)field_RBA.getOldValue()).doubleValue()+((java.math.BigDecimal)field_MAV.getOldValue()).doubleValue()); //$JR_EXPR_ID=88$ <---------------------------------------------------------------------------------------------------------------------------------------------> 3. Cannot cast from double to Double value = (java.lang.Double)(((java.math.BigDecimal)field_RBA.getValue()).doubleValue()+((java.math.BigDecimal)field_MAV.getValue()).doubleValue()); //$JR_EXPR_ID=88$ <---------------------------------------------------------------------------------------------------------------------------------------> Suggestions? Link to comment Share on other sites More sharing options...
mdahlman Posted January 31, 2011 Share Posted January 31, 2011 The simple solution is: don't use JasperServer 3.7.1 and iReport 4.0.0.They are not compatible. JR is generally very good at being backwards compatible. But it's not "forwards compatible". Use iReport 3.7 with JasperServer 3.7, and things should all be good.Regards,Matt Link to comment Share on other sites More sharing options...
sbced Posted February 1, 2011 Author Share Posted February 1, 2011 I'm having the same problem using iReport 3.7.6.I tryed iReport 4.0.0 because of this error ..... Link to comment Share on other sites More sharing options...
sbced Posted February 1, 2011 Author Share Posted February 1, 2011 It seems solved changing the report lenguage from java to groovy ..... 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