jasper report print without dialog box in Products Posted June 14, 2020 I'm using JasperReports to generate pdf and put it to the OutputStream. It it possible to send pdf directly to a printer without displaying dialog box to select the printer?The code i use is JasperPrint jasperPrint = null; response.setContentType("application/x-download"); response.setHeader("Content-Disposition", String.format("attachment; filename=""+fileName+""")); OutputStream out = response.getOutputStream(); String path = resourceLoader.getResource(reportResource).getURI().getPath(); JasperReport jasperReport = JasperCompileManager.compileReport(path); //Map<String, Object> parameters = new HashMap<String, Object>(); jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource); //JasperExportManager.exportReportToPdfStream(jasperPrint, out); /**/ JRPdfExporter exporter = new JRPdfExporter();//tJasperReportsContext.getInstance()); SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration(); if (printDialog) { configuration.setPdfJavaScript("this.print()"); } exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(out)); exporter.setConfiguration(configuration); exporter.exportReport(); Thank
jasper report print without dialog box
in Products
Posted
I'm using JasperReports to generate pdf and put it to the OutputStream. It it possible to send pdf directly to a printer without displaying dialog box to select the printer?
The code i use is
Thank