Jump to content
We've recently updated our Privacy Statement, available here ×

marcin

Members
  • Posts

    4
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by marcin

  1. No one replied to my question, that is sad. I think this forum is not in it best shape. JASPER_PRINT_LIST in jasper 1.3.0 started to work, but it still keeps all printjobs separate, making some tricks like printing multiple pages on one sheet, or printing only even pages impossible. Not mentioning having 1200 dialogs displayed for 1200 separate printjobs. Anyway, I found a workaround, so if someone is having similar problems, this code will merge all separate JasperPrint objects into one: Code: JasperPrint finalJob = null; for (int i=0; i<jasperPrintJobs.size();i++ ) { if (finalJob == null) { finalJob = ((JasperPrint)jasperPrintJobs.get(i)); } else { for (int j=0;j<((JasperPrint)jasperPrintJobs.get(i)).getPages().size();j++) { finalJob.addPage((JRPrintPage) ((JasperPrint)jasperPrintJobs.get(i)).getPages().get(j)); } } } exporter.setParameter(JRExporterParameter.JASPER_PRINT, finalJob); I hope that JASPER_PRINT_LIST behaviour will be fixed one day. Regards Marcin Post edited by: marcin, at: 2007/01/02 02:01
  2. Some time ago someone reported a bug where JRPrintServiceExporter was not working with JASPER_PRINT_LIST. (http://www.jasperforge.org/sf/go/artf1455;jsessionid=E6123CCFB152B5A860B9E3ACA9125CC2?nav=1) The bug is closed, but when I'm trying to print multiple reports, I'm still getting only the first page printed. Does printing multiple reports require some special handling? This is my code, the commented lines does not make any difference: Code: private void exportToPrinter(Report report, List records, List printJobs) throws Exception { JRPrintServiceExporter exporter = new JRPrintServiceExporter(); /* HashPrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); aset.add(MultipleDocumentHandling.SEPARATE_DOCUMENTS_COLLATED_COPIES); aset.add(PrintQuality.DRAFT); aset.add(SheetCollate.COLLATED); aset.add(new PageRanges(1,printJobs.size())); exporter.setParameter( JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, aset); */ exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, printJobs); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE); exporter.exportReport(); } Regards Marcin
×
×
  • Create New...