ddaitarn304gmail.com Posted October 1, 2015 Share Posted October 1, 2015 With previous version I wrote:JRPrintServiceExporter pse = new JRPrintServiceExporter();pse.setParameter(JRPrintServiceExporterParameter.JASPER_PRINT, Job.jrPrint );pse.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, Printer.getService() );pse.setParameter(JRExporterParameter.START_PAGE_INDEX, startPage-1);pse.setParameter(JRExporterParameter.END_PAGE_INDEX, endPage-1);pse.exportReport();[/code] With new version, I use "SimplePrintServiceExporterConfiguration" to configure printing, but I don't find how to set start / end pageJRPrintServiceExporter pse = new JRPrintServiceExporter();SimplePrintServiceExporterConfiguration configuration = new SimplePrintServiceExporterConfiguration();configuration.setPrintService(printService);pse.setConfiguration(configuration); pse.setExporterInput(new SimpleExporterInput(jasperPrint));pse.exportReport();[/code] Link to comment Share on other sites More sharing options...
hozawa Posted October 2, 2015 Share Posted October 2, 2015 Following should set the page number range but it seems JasperReports is overriding the property setting to select all pages. Seems like a bug.printRequestAttributeSet.add(new PageRanges("1-2")); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now