Bonjour,
J'ai un soucis pour générer un report en pdf. Lorsque le report s'enregistre, il m'affiche une page blanche. Pourtant lorsque j'affiche le report dans le viewer, il s'affiche. Voici le code en question :
Si je remplace la ligne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 try { //Loading and compiling the report file. JasperDesign TempJasperDesign = JRXmlLoader.load("Fichier.jxml"); JasperReport TempJasperReport = JasperCompileManager.compileReport(TempJasperDesign); //Generating the report Map test = new HashMap(); test.put("test","test"); JasperPrint TempJasperPrint = JasperFillManager.fillReport(TempJasperReport, test); //Print the report JasperExportManager.exportReportToPdfFile(TempJasperPrint, "result.pdf"); } catch (JRException e) { MessageBox.show(null,e.getMessage(),"ERROR JRE",MessageBox.ICON_INFORMATION); } catch (Exception e){MessageBox.show(null,e.getMessage(),"ERROR",MessageBox.ICON_INFORMATION); }
par :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 JasperExportManager.exportReportToPdfFile(TempJasperPrint, "result.pdf");
le report s'affiche normalement et je peux l'enregistrer en pdf via la fenêtre de preview générée par Jasper.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 JasperViewer.viewReport(TempJasperPrint);
Une idée ??
Partager