update label farmasi
This commit is contained in:
parent
b1e5e933bd
commit
d04cef3e17
@ -341,4 +341,12 @@ public class ReportingController {
|
|||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/label-farmasi/{norec}"}, method = {RequestMethod.GET})
|
||||||
|
public void exportPdfLabelFarmasi(@PathVariable("norec") String norec,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportPdfLabelFarmasi(norec);
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -550,4 +550,18 @@ public class ReportingDao {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfLabelFarmasi(String norec) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jasperDirPath + "label_farmasi_racikan.jrxml";
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
|
parameters.put("norec", norec);
|
||||||
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
|
} catch (Exception var15) {
|
||||||
|
LOG.error("Exception at exportPdfLabelFarmasi");
|
||||||
|
LOG.error(ReportingDao.class, var15);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,4 +155,8 @@ public class ReportingService {
|
|||||||
return this.reportingDao.exportPdfBuktiNoLayanFarmasi(norec);
|
return this.reportingDao.exportPdfBuktiNoLayanFarmasi(norec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfLabelFarmasi(String norec) {
|
||||||
|
return this.reportingDao.exportPdfLabelFarmasi(norec);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,6 @@ spring.datasource.username=postgres
|
|||||||
spring.datasource.password=root
|
spring.datasource.password=root
|
||||||
spring.mvc.dispatch-trace-request=true
|
spring.mvc.dispatch-trace-request=true
|
||||||
spring.main.banner-mode=off
|
spring.main.banner-mode=off
|
||||||
application.jasper-xml.dir-path=/mnt/files/jasper-xml/
|
application.jasper-xml.dir-path=D:\\UP\\
|
||||||
application.pdf.dir-sep=/mnt/files/sep/
|
application.pdf.dir-sep=/mnt/files/sep/
|
||||||
application.pdf.dir-lis=/mnt/lis/
|
application.pdf.dir-lis=/mnt/lis/
|
||||||
Loading…
x
Reference in New Issue
Block a user