pembuatan cetakan sppb
This commit is contained in:
parent
3cbfa444a0
commit
1ac5776fc4
@ -314,4 +314,12 @@ public class ReportingController {
|
|||||||
response.setContentType("application/pdf");
|
response.setContentType("application/pdf");
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/sppb/{norec}"}, method = {RequestMethod.GET})
|
||||||
|
public void exportSppb(@PathVariable("norec") String norec,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportPdfSppb(norec);
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -421,4 +421,18 @@ public class ReportingDao {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfSppb(String norec) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jasperDirPath + "sppb.jrxml";
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
|
parameters.put("norec", norec);
|
||||||
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("Exception at exportPdfSppb");
|
||||||
|
LOG.error(ReportingDao.class, e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,4 +127,8 @@ public class ReportingService {
|
|||||||
public JasperPrint exportPdfMonitoringUsulan(String norec) {
|
public JasperPrint exportPdfMonitoringUsulan(String norec) {
|
||||||
return this.reportingDao.exportPdfMonitoringUsulan(norec);
|
return this.reportingDao.exportPdfMonitoringUsulan(norec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfSppb(String norec) {
|
||||||
|
return this.reportingDao.exportPdfSppb(norec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user