Update service reporting
Pembuatan api cetakan summary list
This commit is contained in:
parent
8765506b7f
commit
75abeb5471
@ -276,4 +276,12 @@ public class ReportingController {
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/summary-list/{nocm}"}, method = {RequestMethod.GET})
|
||||
public void exportSummaryList(@PathVariable("nocm") String nocm,
|
||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||
JasperPrint jasperPrint = this.reportingService.exportPdfSummaryList(nocm);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,6 @@ public class ReportingDao {
|
||||
exporter.setConfiguration(configuration);
|
||||
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
|
||||
PrintService selectedService = null;
|
||||
int var10 = services.length;
|
||||
for (PrintService service : services) {
|
||||
String existingPrinter = service.getName();
|
||||
if (existingPrinter.equals(selectedPrinter)) {
|
||||
@ -362,4 +361,18 @@ public class ReportingDao {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfSummaryList(String nocm) {
|
||||
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||
String path = jasperDirPath + "summaryList.jrxml";
|
||||
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("nocm", nocm);
|
||||
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Exception at exportPdfLabelPaket");
|
||||
LOG.error(ReportingDao.class, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,4 +95,8 @@ public class ReportingService {
|
||||
public JasperPrint exportPdfResumeMedis(String norec) {
|
||||
return this.reportingDao.exportPdfResumeMedis(norec);
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfSummaryList(String nocm) {
|
||||
return this.reportingDao.exportPdfSummaryList(nocm);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user