Update service reporting
Pemasangan API cetakan monitoring usulan barang
This commit is contained in:
parent
2b062bff69
commit
3cbfa444a0
2
pom.xml
2
pom.xml
@ -77,7 +77,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.jasperreports</groupId>
|
<groupId>net.sf.jasperreports</groupId>
|
||||||
<artifactId>jasperreports</artifactId>
|
<artifactId>jasperreports</artifactId>
|
||||||
<version>6.4.0</version>
|
<version>6.11.0</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.lowagie</groupId>
|
<groupId>com.lowagie</groupId>
|
||||||
|
|||||||
@ -306,4 +306,12 @@ public class ReportingController {
|
|||||||
response.setContentType("application/pdf");
|
response.setContentType("application/pdf");
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/usulan/{norec}"}, method = {RequestMethod.GET})
|
||||||
|
public void exportMonitoringUsulan(@PathVariable("norec") String norec,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportPdfMonitoringUsulan(norec);
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -407,4 +407,18 @@ public class ReportingDao {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfMonitoringUsulan(String norec) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jasperDirPath + "monitoring_usulan.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 exportPdfMonitoringUsulan");
|
||||||
|
LOG.error(ReportingDao.class, e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,4 +123,8 @@ public class ReportingService {
|
|||||||
public JasperPrint exportPdfKwitansi(String noSbm) {
|
public JasperPrint exportPdfKwitansi(String noSbm) {
|
||||||
return this.reportingDao.exportPdfKwitansi(noSbm);
|
return this.reportingDao.exportPdfKwitansi(noSbm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfMonitoringUsulan(String norec) {
|
||||||
|
return this.reportingDao.exportPdfMonitoringUsulan(norec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user