justelnegro Posted July 28, 2010 Share Posted July 28, 2010 Hi, im using ireport 3.7.3 and also jasperreport 3.7.3 my problem is that i build a report in ireport that works fine, but in jasperReport using java code to call it doesn't work i check if the version of jasper that uses ireport is the same and yes, they match.The error that i got in jasper is: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : ($F{COLUMN_1}.toString().equalsIgnoreCase("PARTIALLY_RECEIVED")?$V{itemCheckSelected}:$V{itemCheckUnSelected})Cause:java.lang.ClassCastException: com.cinet.gcp.domain.TransactionStatusBecause the field call COLUMN_1 = is a enum i don't know where the problem is because i add the jar that contain the class in the classpath of the project that call to the report. I'm going to attach the file of the report and the code that i use to call the report. Thanks and i hope that someone could help meCode: //obtain the initial JNDI context Context initCtx = new InitialContext(); // perform JNDI lookup to obtain container-managed entity manager javax.persistence.EntityManagerFactory entityManagerFactory = (javax.persistence.EntityManagerFactory) initCtx.lookup("java:/gcp"); EntityManager entityManager = entityManagerFactory.createEntityManager(); HashMap<String,Object> hashMap = new HashMap<String, Object>(); JasperDesign jasperDesign = null; JasperPrint jasperPrint = null; JasperReport jasperReport = null;jasperDesign = JRXmlLoader.load("C:/Users/Jorge/Desktop/trabajo/ReportesMigrados/NotaDeRecepcionNuevo.jrxml"); hashMap.put("JPA_ENTITY_MANAGER",entityManager); hashMap.put("itemImage", "file:///C:/jboss-4.2.3.GA/server/default/deploy/gcp-1.0.ear/blazedsGCPTriad.war/documents/image"); hashMap.put("itemName", 431L); hashMap.put("NotaRecepcion", "file:///C:/jboss-4.2.3.GA/server/default/deploy/gcp-1.0.ear/blazedsGCPTriad.war/documents/image");//the template is compiled into memory jasperReport = JasperCompileManager.compileReport(jasperDesign); jasperPrint = JasperFillManager.fillReport(jasperReport, hashMap); 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