Guest User

Untitled

a guest
Jul 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. //menentukan file jrmxl yang akan di compile
  2. JasperReport jasperReport = null;
  3. try {
  4. jasperReport = JasperCompileManager.
  5. compileReport("./src/perpustakaan/report/TagihanBuku.jrxml");
  6. } catch (JRException e1) {
  7. e1.printStackTrace();
  8. }
  9.  
  10. //compile file .jrmxl ke .jasper
  11. try {
  12. JasperCompileManager.compileReportToFile("./src/perpustakaan/report/TagihanBuku.jrxml",
  13. "./src/perpustakaan/report/TagihanBuku.jasper");
  14. } catch (JRException e1) {
  15. e1.printStackTrace();
  16. }
  17.  
  18. //mengisi dan menampilkan report
  19. JasperPrint jasperPrint = null;
  20. try {
  21. jasperPrint = JasperFillManager.fillReport(jasperReport,
  22. new HashMap(), new JRBeanCollectionDataSource(getDataSource()));
  23. JasperViewer.viewReport(jasperPrint);
  24. } catch (JRException e1) {
  25. e1.printStackTrace();
  26. }
Add Comment
Please, Sign In to add comment