File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

jasper report print | server side | not printing properly

soooori vadlamudi

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(new Copies(1));

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

PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();

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);

Any suggestions/help is appreciatable.


I agree. Here's the link:
subject: jasper report print | server side | not printing properly
It's not a secret anymore!