HashMap parameterMap = new HashMap (); String report_dir = System.getProperty ("user.dir") + "// Reports //"; String file = report_dir + "fatper.jasper"; parameterMap.put ("data_ini", dateIni); parameterMap.put ("data_fim", dateFim); parameterMap.put ("company_code", company); parameterMap.put ("company", reasonEmp); parameterMap.put ("address", enderEmp); parameterMap.put ("environment type", environment); parameterMap.put ("environment", environment == "1"? "1 - Production": "2 - Homologation");
JasperPrint jp = JasperFillManager.fillReport(arquivo, parameterMap, confat);
JasperViewer viwer = new JasperViewer(jp, false);
viwer.setVisible(true);
And the following error, when I use version 6.6: Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: Method org / postgresql / jdbc2 / Jdbc2DatabaseMetaData.getDatabaseMajorVersion () I is abstract at org.postgresql.jdbc2.Jdbc2DatabaseMetaData.getDatabaseMajorVersion (Jdbc2DatabaseMetaData.java) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter (JRJdbcQueryExecuter.java:154) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory.createQueryExecuter (JRJdbcQueryExecuterFactory.java:207) at net.sf.jasperreports.engine.query.QueryExecuterFactory.createQueryExecuter (QueryExecuterFactory.java:109) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource (JRFillDataset.java:1254) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource (JRFillDataset.java:726) at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters (BaseReportFiller.java:456) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill (JRBaseFiller.java:578) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill (BaseReportFiller.java:413) at net.sf.jasperreports.engine.fill.JRFiller.fill (JRFiller.java:120) at net.sf.jasperreports.engine.JasperFillManager.fill (JasperFillManager.java:319) at net.sf.jasperreports.engine.JasperFillManager.fillReport (JasperFillManager.java:850)