Home
Analytics
Access to Total Pages of Report!!!
Mad68
Hi,
How can I access the value stored in a autotext as total-page?
Is that need to simulate this element, that iSever 9SP2 not working well.
Greetings and thanks
Find more posts tagged with
Comments
Mad68
<blockquote class='ipsBlockquote' data-author="Mad68"><p>Hi,<br />
<br />
How can I access the value stored in a autotext as total-page?<br />
<br />
Is that need to simulate this element, that iSever 9SP2 not working well.<br />
<br />
Greetings and thanks</p></blockquote>
<br />
The version I use is 2.1.3 and run reports from the iServer 9SP2.<br />
<br />
Please, <br />
Someone I can lend a hand.<br />
<br />
Best Regards.<br />
Mad68
Virgil Dodson
Hi Mad68,<br />
<br />
It looks like there is a bug that prevents using the totalPage in a text control. See <a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205386'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=205386</a><br
/>
<br />
I do not know of a workaround that allows you to simulate the total page count since it needs to run the whole report and render it into the proper format before it can know the total count.
Mad68
Hi vdodson, thank you for your reply.
The element AutoText can work as PageNumber or TotalPage, Like the Text element, AutoText should have a property called "text" or "caption" or "value" is not it?.
In that case, is there any way through JavaScript to access this property?.
For example:
reportContext.getReportRunnable().designHandle.getDesignHandle().getElementByID(1973).name
Returns the name of the element AutoText.
Is something similar could be done to recover the value stored?
Best regards and thanks
esuku
Where you able to figure out how to capture the value (Total Page Count) from Auto Text. Please do let me know.
johnw
I have a workable solution, but its not easy to implement. Basically it requires you to use Reflection to get to the Report Document, and using the Doc, you can get page count. Its only applicable to the render phase. Let me know if you want me to post it.
esuku
Yes please. I am working with BIRT 2.2.2 (compatible with IBM Rational RequisitePro).. hope that is not an issue.
Thanks for helping!
johnw
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/929-using-reflection-to-get-total-page-count-during-render-time/#description'>Using
Reflection to Get Total Page Count During Render Time - Designs & Code - BIRT Exchange</a><br />
<br />
Keep in mind, since there isn't a out of the box report item that updates during render time except the Chart, I had to use a chart to show the total number of pages since regular text and data items are populated during run time, not render time. I suppose we could create a data item extension to do so. But t his should work for debugging what you need.<br />
<br />
John
vcarton
with birt 2.2.2 and 2.3.2, reflection is nor working.
getClass() on reportContext is unknomn. so this impossible to get the reportDocument.
any idea ?
thanks.