update dkamar

This commit is contained in:
ridwan 2025-01-14 11:31:32 +07:00
parent eb35ebeec8
commit f322b3880f
3 changed files with 24 additions and 0 deletions

View File

@ -362,4 +362,11 @@ public class ReportingController {
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/dashboard-kamar"}, method = {RequestMethod.GET})
public void exportPdfDKamar(ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfDKamar();
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
}

View File

@ -584,4 +584,17 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfDKamar() {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "dkamar.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception e) {
LOG.error("Exception at exportPdfDKamar");
LOG.error(ReportingDao.class, e);
}
return null;
}
}

View File

@ -163,4 +163,8 @@ public class ReportingService {
return this.reportingDao.exportPdfLaporanTindakan(ruanganid, instalasiid, kelasid, unitid, produkid, statusprodukid);
}
public JasperPrint exportPdfDKamar() {
return this.reportingDao.exportPdfDKamar();
}
}