I'm working with JasperReport from your IReport plugin.
I have already designed all my form from this plugin but at the moment of running my application it gives me the following exception:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/PropertyUtils
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:111)
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:96)
at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:100)
at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1331)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1232)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1208)
at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1577)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:149)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:864)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:88)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:969)
at REPORTE.FacturaReporte.crearPDF(FacturaReporte.java:51)
The code trying to open the JasperReport is the following:
public void crearPDF(Factura miFactura, Cliente unCliente) throws JRException {
//Creo mi lista con los parametros a enviar
Map misParametros = new HashMap();
misParametros.put("codigoFactura", miFactura.getCodigo());
misParametros.put("fechaFactura", new SimpleDateFormat("dd-MM-yyyy").format(miFactura.getFecha().getTime()));
misParametros.put("dniCliente", unCliente.getDni());
misParametros.put("nombreCliente", unCliente.getMisDatosPersonales().getNombre());
misParametros.put("apellidoCliente", unCliente.getMisDatosPersonales().getApellido());
misParametros.put("telefonoCliente", unCliente.getMisDatosPersonales().getTelefono());
//Creo la variable que contendrá el reporte
JasperReport miReporte = (JasperReport) JRLoader.loadObjectFromFile("src/REPORTE/Factura.jasper");
// Definimos cual sera nuestra fuente de datos
JRBeanCollectionDataSource datos = new JRBeanCollectionDataSource(miFactura.getRenglones());
//Preparo para mostrar
JasperPrint miJasperPrint = JasperFillManager.fillReport(miReporte, misParametros ,datos);
JasperViewer miJasperViewer = new JasperViewer(miJasperPrint, false);
//Le doy un titulo al documento
miJasperViewer.setTitle("Factura "+ miFactura.getCodigo() +"");
//Lo hago visible
miJasperViewer.setVisible(true);
}
As you may have already noticed, the problem is detected in the following line:
//Preparo para mostrar
JasperPrint miJasperPrint = JasperFillManager.fillReport(miReporte, misParametros ,datos);
I suspect that you are referring to a problem with a JAR / Library or something like that. Would you give me any help?