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

Execution time some fields are nulls, but in the Preview all it's right.


efrojaspy

Recommended Posts

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.

  1. jasperreports-5.1.0.jar
  2. jasperreports-fonts-5.0.4.jar
  3. jasperreports-javaflow-5.2.0.jar
  4. commons-beanutils-1.8.2.jar
  5. commons-collections-3.2.1.jar
  6. commons-digester-2.1.jar
  7. commons-javaflow-20060411.jar
  8. commons-logging-1.1.jar
  9. groovy-all-2.0.1.jar
  10. iText-2.1.7.js2.jar
  11. png-encoder-1.5.jar
  12. poi-3.7-20101029.jar
  13. jasperreports-extensions-3.5.3.jar
  14. ojdbc6.jar
  15. orai18n.jar

Here 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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...