aqui os dejo parte de mi codigo
Código HTML:
@SuppressWarnings("unchecked") @FXML private void moreFCa() { try { JasperReport reporte = (JasperReport)JRLoader.loadObjectFromFile("C:\\Users\\dqvol\\Desktop\\programa 1\\niks\\reportes\\Orden.jasper"); HashMap parametros = new HashMap(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); if(FechaCarga.getValue()!=null) { parametros.put("FechaCa", FechaCar.getValue().format(formatter)); }else { parametros.put("FechaCarga", ""); } JasperPrint jp = JasperFillManager.fillReport(reporte,(Map<String, Object>) parametros,new JREmptyDataSource()); JasperViewer view = new JasperViewer(jp); view.setTitle("Factura"); view.setVisible(false); }catch(Exception ex) { System.out.println(ex.getMessage()); } } @SuppressWarnings("unchecked") @FXML private void CrearReporte() { try { JasperReport reporte = (JasperReport)JRLoader.loadObjectFromFile("C:\\Users\\dqvol\\Desktop\\programa 1\\niks\\reportes\\Orden.jasper"); HashMap parametros1 = new HashMap(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); parametros1.put("FechaCa", FechaCar.getValue().format(formatter)); JasperPrint jp = JasperFillManager.fillReport(reporte,(Map<String, Object>) parametros1,new JREmptyDataSource()); JasperViewer view = new JasperViewer(jp); view.setTitle("Factura"); view.setVisible(true); }catch(Exception ex) { System.out.println(ex.getMessage()); } }