[JasperReports] Impossible d'appeler JasperReports à partir du fichier JAR
Je travaille avec netbeans sur une application Java Desktop, dans cette application j'ai implémenté JasperReports, qui est compilé avec iReport.
Quand j’exécute l'application l'ireport s’exécute bien sans problème, même le .jar marche bien.
Mais quand je pose le fichier .jar dans un autre ordi, l'application fonction bien sauf l ireport qui ne marche pas l'application reste bloqué lors du clic du bouton.
Voila mon code:
Code:
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);}
} |