soooori vadlamudi

Greenhorn
+ Follow
since Jan 06, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by soooori vadlamudi

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
14 years ago