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)
Problem with getBookmarks()
Joram
Hi all,<br />
<br />
When I'm generating a report I want to write the page numbers of specific bookmarks in a separate file. This is part of my code:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IRunTask runTask = engine.createRunTask(design);
runTask.setParameterValues(params);
runTask.run(REPORT_DOCUMENT);
runTask.close();
IReportDocument document = engine.openReportDocument(REPORT_DOCUMENT);
for (Object b : document.getBookmarks()) {
String bookmark = (String) b;
// write bookmark and page number to file
}
</pre>
<br />
Now when I have a 3-page report document, i only get 3 bookmarks ("__bookmark_1", "__bookmark_2", "__bookmark_3") but not any of the ones I set in the report design using the bookmark section in the properties view.<br />
<br />
<br />
Am I missing something?<br />
<br />
On a side note, the document objects property map contains the following values:<br />
{page hint version=4, extraction=1, BIRT ENGINE VERSION=2.6.1, BIRT ENGINE BUILD NUMBER=/C:/birt-runtime-3_7_1/ReportEngine/lib/org.eclipse.birt.runtime_3.7.1.v20110913-1734.jar}<br />
<br />
Is the BIRT ENGINE VERSION=2.6.1 correct?<br />
<br />
Your help is highly appreciated,<br />
best regards, Joram
Find more posts tagged with
Comments
Joram
I solved it! The problem was that my bookmark text in the report designer (which was static) didn't have " around it. In the expression builder, instead of just setting the value to: <pre class='_prettyXprint _lang-auto _linenums:0'>BookmarkA</pre> use <pre class='_prettyXprint _lang-auto _linenums:0'>"BookmarkA"</pre>