update buktipengeluaranbarang
This commit is contained in:
parent
d4d9ef1ce8
commit
1395da9441
@ -820,7 +820,7 @@ public class ReportingController {
|
|||||||
jasperPrint = this.reportingService.exportPdfKwitansiCollectingPiutang(norec, PrintBy);
|
jasperPrint = this.reportingService.exportPdfKwitansiCollectingPiutang(norec, PrintBy);
|
||||||
response.setContentType("application/pdf");
|
response.setContentType("application/pdf");
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}finally {
|
} finally {
|
||||||
jasperPrint = null;
|
jasperPrint = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -848,9 +848,21 @@ public class ReportingController {
|
|||||||
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
|
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
|
||||||
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
|
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
|
||||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
JasperPrint jasperPrint = this.reportingService.exportPdfdaftarPenerimaBarangFarmasi(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
|
JasperPrint jasperPrint = null;
|
||||||
response.setContentType("application/pdf");
|
try {
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
jasperPrint = this.reportingService.exportPdfdaftarPenerimaBarangFarmasi(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||||
|
try (OutputStream outputStream = response.getOutputStream()) {
|
||||||
|
// Ekspor PDF ke stream
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||||
|
|
||||||
|
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||||
|
System.gc();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
jasperPrint = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/bukti-pengeluaran-barang/{norec}"}, method = {RequestMethod.GET})
|
@RequestMapping(value = {"/bukti-pengeluaran-barang/{norec}"}, method = {RequestMethod.GET})
|
||||||
@ -863,19 +875,20 @@ public class ReportingController {
|
|||||||
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
|
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
|
||||||
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
|
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
|
||||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiPengeluaranBarang(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
|
JasperPrint jasperPrint = null;
|
||||||
response.setContentType("application/pdf");
|
try {
|
||||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
jasperPrint = this.reportingService.exportPdfBuktiPengeluaranBarang(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
|
||||||
try (OutputStream outputStream = response.getOutputStream()) {
|
response.setContentType("application/pdf");
|
||||||
// Ekspor PDF ke stream
|
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
try (OutputStream outputStream = response.getOutputStream()) {
|
||||||
|
// Ekspor PDF ke stream
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||||
|
|
||||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||||
// Catatan: Ini bukan jaminan, tetapi bisa mengurangi risiko OutOfMemoryError
|
System.gc();
|
||||||
System.gc();
|
}
|
||||||
} catch (Exception e) {
|
} finally {
|
||||||
// Log error jika diperlukan (opsional, tambahkan logging sesuai kebutuhan aplikasi)
|
jasperPrint = null;
|
||||||
throw e; // Rethrow untuk menjaga perilaku asli
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user