Jump to content
Changes to the Jaspersoft community edition download ×

Setting paper size and orientation


davidgarratt

Recommended Posts

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();      configuration.setPrintRequestAttributeSet(printRequestAttributeSet);      configuration.setPrintServiceAttributeSet(printServiceAttributeSet);      configuration.setDisplayPageDialog(false);      configuration.setDisplayPrintDialog(mod.isPrintDialog());      exporter.setExporterInput(simpleexporterinput);      exporter.setConfiguration(configuration);      exporter.exportReport(); [/code]

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

 

Dave

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...