Jump to content
We've recently updated our Privacy Statement, available here ×

justelnegro

Members
  • Posts

    1
  • Joined

  • Last visited

justelnegro's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. 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.TransactionStatus Because 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 me Code: //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);
×
×
  • Create New...