1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
public void report(){
//parameter
int numR = Integer.parseInt(recueField.getText());
int idapp = Integer.parseInt(appField.getText());
//set parameters
HashMap map = new HashMap();
map.put("numR", numR);
map.put("idapp", idapp);
try{
String REPORT ="C:\\Users\\makro\\Documents\\NetBeansProjects\\syndicat c\\src\\syndicat_c\\Recu.jrxml";
JasperReport jasp_rep = JasperCompileManager.compileReport(REPORT);
JasperPrint jasp_print = JasperFillManager.fillReport(jasp_rep,map,con);
JasperExportManager.exportReportToPdfFile(jasp_print,"C:\\Syndiv\\Enregistrements\\Recu/Recu "+recueField.getText()+".pdf");
JasperPrintManager.printReport(jasp_print,false);
}catch(Exception e){JOptionPane.showMessageDialog(null,e);}
} |
Partager