Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
setPageRange issue
cwfranklin
Hello all,
I am having an issue with the setPageRange() method. I need to use page range to split large reports into multiple pdf documents because our server does not have enough memory to support a large report.
It seems that when the page range is in the the middle of the total number of pages it gives me a blank first page that only contains the table header and master page footer. For example setPageRange("1-300") works fine, but setPageRange("301-600") renders 301 pages with a blank first page.
Has anyone else had this problem or knows a fix for it? Thanks in advance, any help is greatly appreciated.
Find more posts tagged with
Comments
Virgil Dodson
I can't seem to reproduce this. Have you tried playing around with the page break settings on the table? Are you forcing a page break Before a group for instance?
cwfranklin
Thanks for the reply vdodson,
I have set all page ranges to "avoid" on the master page and on the table itself in the layout. I also have grids within the table. I have not, however, set them to avoid page breaks.
What I don't understand is why there is no blank page if I start the page range with 1. and its not like there is a record there because I am getting all the records when I split the pdfs I just have extra pages.
I am working with Birt 2.2.0, if that helps any.
cwfranklin
Here is a snippet of the code that i use to generate the report. Please review it and let me know if I'm missing something because I am still having the same issue.
IReportRunnable design = BirtEngine.openReportDesign(reportDesignName);
// create task to run report
IRunTask runTask = birtReportEngine.createRunTask(design);
runTask.setParameterValues(parms);
runTask.validateParameters();
runTask.run(reportDesignName);
IReportDocument rptdoc = birtReportEngine.
openReportDocumentreportDesignName);
// create task to render report
IRenderTask renderTask = birtReportEngine.createRenderTask(rptdoc);
pageCount = rptdoc.getPageCount();
IPDFRenderOption options = new PDFRenderOption();
ByteArrayOutputStream reportBA = new ByteArrayOutputStream();
options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF);
options.setOutputStream(reportBA);
renderTask.setPageRange("2-5"); //Not starting from page 1
renderTask.render();
renderTask.close();
When set the page range from 1-5 it works fine, but when I set from 2-5 i get a blank first page.
Thanks
Virgil Dodson
I can't reproduce it in either 2.3.2 or 2.5... and the code looks very similar to mine.
There are a couple of things I would try. First, try to make a new simple report in your 2.2.0 and see if it happens to all reports created there... or just the one your working on.
If it happens to all your reports, then try downloading a newer BIRT version to test against. I couldn't find a bug for the setPageRange method producing a blank page, but maybe something got fixed since 2.2.0.