I have a big problem:
Context:
I have a web application with primefaces 6.0 and ireport 4.0 where I print several reports in pdf format, all of them work correctly.
Problem:
I need a report to be printed directly on the printer ( the name of the printer must be parameterized, since it is not the default ) of the client, as the report is executed on the server when reading the installed printers, it does not find anything, since on the server ( Linux Red Hat ) there is no printer installed.
I attach the code that sends to the default printer, but do not forget that I want to send it to another printer:
String ctxPath = getServletContext().getRealPath("/");
connection = utilServiceDelegate.getDataSource()
.getConnection();
HttpServletResponse response = (HttpServletResponse) FacesContext
.getCurrentInstance().getExternalContext()
.getResponse();
JasperPrint jasperPrint = JasperFillManager.fillReport(ctxPath+ rutaReporte, parameters,
connection);
JasperPrintManager.printReport(jasperPrint, false);
If anyone has solved this with ireport 4 or lower, I'd really appreciate it.
Thanks.