Setting paper size and orientation

When I create a report using iReport I setup the page size etc. Does this mean than I don't need to set properties at runtime in Java as well ? I ask as I recently updated my java code which runs my reports by some of the reports printed incorrectly using only a small part of the page.

This is a fragment of my java code,

      exporter = new JRPrintServiceExporter();
         PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
      printRequestAttributeSet.add(new Copies(mod.getPrintCopies()));
         PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();
         printServiceAttributeSet.add(new PrinterName(JPrint.getPrinterShortName(JPrint.getPreferredPrinterQueueName()), null));    
      SimpleExporterInput simpleexporterinput = new SimpleExporterInput(jasperPrint);
      SimplePrintServiceExporterConfiguration configuration = new SimplePrintServiceExporterConfiguration();

I'm not sure if my code is missing something or there is a problem with the report definition (some of my reports are quite old now)

Thanks in advance


davidgarratt's picture
Joined: Sep 17 2013 - 8:13pm
Last seen: 7 months 5 days ago

1 Answer:

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 7 months ago

I understand what the link it saying in as much that you can override the page layout. My problem seems to be that I'm not getting the initial layout (default) from the report file itself. A report which should be A4 printed in a small square in the centre of the page with about 3inch borders on all sides.

davidgarratt - 8 years 7 months ago