Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //menentukan file jrmxl yang akan di compile
- JasperReport jasperReport = null;
- try {
- jasperReport = JasperCompileManager.
- compileReport("./src/perpustakaan/report/TagihanBuku.jrxml");
- } catch (JRException e1) {
- e1.printStackTrace();
- }
- //compile file .jrmxl ke .jasper
- try {
- JasperCompileManager.compileReportToFile("./src/perpustakaan/report/TagihanBuku.jrxml",
- "./src/perpustakaan/report/TagihanBuku.jasper");
- } catch (JRException e1) {
- e1.printStackTrace();
- }
- //mengisi dan menampilkan report
- JasperPrint jasperPrint = null;
- try {
- jasperPrint = JasperFillManager.fillReport(jasperReport,
- new HashMap(), new JRBeanCollectionDataSource(getDataSource()));
- JasperViewer.viewReport(jasperPrint);
- } catch (JRException e1) {
- e1.printStackTrace();
- }
Add Comment
Please, Sign In to add comment