Two Laptop Bag*
The moose likes Other Java Products and Servers and the fly likes jasper report print | server side | not printing properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "jasper report print | server side | not printing properly" Watch "jasper report print | server side | not printing properly" New topic
Author

jasper report print | server side | not printing properly

soooori vadlamudi
Greenhorn

Joined: Jan 06, 2010
Posts: 1
Hi All,

I am trying to print jasper report using Jasperprint api, on server side(this is scheduler job which prints reports at regular intervals without user interaction).the problem i face is while printing it is cutting/removing some of the columns on the right hand side(i mean its not adjusting/fitting/stretching whole report into a page while print).But viewing same report is fine, it displays properly all the columns.

Please let me know if need to call any APIs or any settings.

sample code that i am using:

JasperPrint jp =reportEngine.fillReport() ;//it returns stream
PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
printRequestAttributeSet.add(MediaSizeName.ISO_A4);
printRequestAttributeSet.add(new Copies(1));

PrinterName printerName =new PrinterName("printername", null); //gets printer

PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();
printServiceAttributeSet.add(printerName);

JRPrintServiceExporter exporter = new JRPrintServiceExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
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.FALSE);
exporter.exportReport();

Any suggestions/help is appreciatable.





Thanks,

Surendra
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jasper report print | server side | not printing properly