I am using JasperReports 1.3.1 to print the report. I am sing eclipse and tomcat for development purpose.
In eclipse, when i run the application, the below code will show the listed printer devices and print button. If i click the print button, the report is printing by selected device.
PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
printRequestAttributeSet.add(MediaSizeName.ISO_A5);
PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();
JRPrintServiceExporter exporter = new JRPrintServiceExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE);
exporter.exportReport();
Here I am passing jasperPrint as a parameter which i manually construted.Its working good
My problem is:
I created war file and pasted in tomcat Apache Software Foundation\Tomcat 6.0\webapps
directory and started the tomcat by using services.msc.
At this point, its not displaying the listed printer details and also not printing.
I put some logger, I found that, the code is hanging with exporter.exportReport();
after this line code is not executing .
Please suggest me for how to print from client side using jasper