efrojaspy Posted January 15, 2014 Share Posted January 15, 2014 Hi Everyone!I have JasperSoft Studio 5.5.0 final with jdk 7u9. I'm finished the report and can see all the fields with correct values in the Preview.Then I export jasper's files to Eclipse (same jdk). I running the class. I open the outcome file and can view the entire report but with some fields nulls.The list of jars.jasperreports-5.1.0.jarjasperreports-fonts-5.0.4.jarjasperreports-javaflow-5.2.0.jarcommons-beanutils-1.8.2.jarcommons-collections-3.2.1.jarcommons-digester-2.1.jarcommons-javaflow-20060411.jarcommons-logging-1.1.jargroovy-all-2.0.1.jariText-2.1.7.js2.jarpng-encoder-1.5.jarpoi-3.7-20101029.jarjasperreports-extensions-3.5.3.jarojdbc6.jarorai18n.jarHere the sample code of my class in Eclipse.import net.sf.jasperreports.engine.*;import net.sf.jasperreports.engine.export.JRPdfExporter;import net.sf.jasperreports.engine.util.JRLoader;import java.util.*;import MotorSQL.MotorSQL; public static void GENERATION2FILE(String prmJSFile,String prmFileName,HashMap<String, Object> prmParameters,MotorSQL prmMotor,String prmUsuarioId,int prmEntidadId) { try { JasperReport reporte = (JasperReport) JRLoader.loadObjectFromFile(prmJSFile); JasperPrint jasperPrint = JasperFillManager.fillReport(reporte, prmParameters, prmMotor.getConnection()); JRExporter exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE, new java.io.File(prmFileName)); exporter.exportReport(); } catch (JRException e) { e.printStackTrace(); System.exit(1); } catch (Exception e) { e.printStackTrace(); System.exit(1); }Can you helpme?Thanks a lot. Link to comment Share on other sites More sharing options...
efrojaspy Posted January 20, 2014 Author Share Posted January 20, 2014 Hello! I've resolved my issue. The problem was report language Groovy. I mean, I don't installed groovy's jars in the new class.My advice is use java for text expression. Thansk a lot. 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