Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
pageCount, TOC incorrect
StevenHovater
hi folks
Using BIRT 2.3.2, I've split the generation between a run and a render task.
In between, I'm accessing the TOC of the IReportDocument, but the results are wrong.
When finally rendered, my sample report is 16 pages. The rptdocument seems to think there are only 5 pages.
Add to that confusion - as I examine the TOC, I see that when I attempt to get the page number for each TOC entry, the page numbers returned are incorrect. I'm expecting that the page count should be equal to the page count in the rendered document.
...
IReportDocument rptdoc = engine.openReportDocument(rptdocname);
TOCNode td = rptdoc.findTOC(null);
List<TOCNode> children = td.getChildren();
System.out.println("PageCount: " + rptdoc.getPageCount());
PrintWriter tf = new PrintWriter(tocfile);
long pNumber;
if (children != null && children.size() > 0) {
for (TOCNode child : children) {
String display = child.getDisplayString();
String bookmark = child.getBookmark();
pNumber = rptdoc.getPageNumber(bookmark);
tf.println(display + "t" + bookmark + "t" + pNumber);
}
}
...
Any ideas on why the page count and bookmark page numbers may be wrong?
thanks
Steve
Find more posts tagged with
Comments
JasonW
When you render are you rendering in html or pdf. The pages are html pages not pdf pages. You may need to lower your page break intervals to match up the pages.
Jason
StevenHovater
hi Jason
Rendering in PDF. Will try your suggestion.
thanks,
Steve