diff --git a/src/main/java/com/reporting/controller/ReportingController.java b/src/main/java/com/reporting/controller/ReportingController.java index cb8403e..34c88e3 100644 --- a/src/main/java/com/reporting/controller/ReportingController.java +++ b/src/main/java/com/reporting/controller/ReportingController.java @@ -1022,8 +1022,9 @@ public class ReportingController { @RequestMapping(value = {"/smpk/{smpk}"}, method = {RequestMethod.GET}) public void exportPdfSMPK(@PathVariable("smpk") Integer smpk, + @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, ModelAndView mv, HttpServletResponse response) throws Exception { - JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk); + JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk,printBy); response.setContentType("application/pdf"); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); } diff --git a/src/main/java/com/reporting/dao/ReportingDao.java b/src/main/java/com/reporting/dao/ReportingDao.java index 4554e5a..f41d4c0 100644 --- a/src/main/java/com/reporting/dao/ReportingDao.java +++ b/src/main/java/com/reporting/dao/ReportingDao.java @@ -1280,12 +1280,13 @@ public class ReportingDao { return null; } - public JasperPrint exportPdfSMPK(Integer smpk) { + public JasperPrint exportPdfSMPK(Integer smpk, String printBy) { try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) { String path = jasperDirPath + "SMPK_testing.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); Map parameters = new HashMap<>(); parameters.put("smpk", smpk); + parameters.put("printBy", printBy); return JasperFillManager.fillReport(jasperReport, parameters, conn); } catch (Exception var15) { LOG.error("Exception at exportPdfSMPK"); diff --git a/src/main/java/com/reporting/service/ReportingService.java b/src/main/java/com/reporting/service/ReportingService.java index 250bbec..74b38a1 100644 --- a/src/main/java/com/reporting/service/ReportingService.java +++ b/src/main/java/com/reporting/service/ReportingService.java @@ -449,8 +449,8 @@ public class ReportingService { } } - public JasperPrint exportPdfSMPK(Integer smpk) { - return this.reportingDao.exportPdfSMPK(smpk); + public JasperPrint exportPdfSMPK(Integer smpk, String printBy) { + return this.reportingDao.exportPdfSMPK(smpk, printBy); } public JasperPrint exportPdfRekapLogbook(String tahun, String bulan, Integer ksm_id, Integer pegawai_id , String printBy) {