Page Number and pageTotal problem [message #1016569] |
Wed, 06 March 2013 18:29  |
Eclipse User |
|
|
|
Hi,
in my report there is a table that takes,in ppt or pdf format, several pages; i would insert the number of pages in a simply format (<page> of <total>) but the value of pageNumber and pageTotal is always 1.
How can I fix this?
Thanks
|
|
|
|
|
|
|
Re: Page Number and pageTotal problem [message #1017085 is a reply to message #1016934] |
Fri, 08 March 2013 16:51   |
Eclipse User |
|
|
|
If you put this in your text box, in the right column:
<value-of> pageNumber </value-of> / <value-of> totalPage </value-of>
Then, run it to the web viewer and export to pdf, it works correctly. When you deploy the viewer, this would simply be calling the report with the frameset mapping and format=pdf, in the URL, which uses the separate run and render tasks, which is necessary for this to work. If you use the API's to run your reports, you'd just use the separate tasks, rather than the runAndRender task. Hope this helps.
|
|
|
|
|
|
|
|
|
Re: Page Number and pageTotal problem [message #1017377 is a reply to message #1017333] |
Mon, 11 March 2013 13:47   |
Eclipse User |
|
|
|
Michael Williams wrote on Mon, 11 March 2013 11:55Without being able to use the masterpage and without using separate run and render tasks, you're probably not going to be able to achieve what you're wanting. You could compute the total pages to show correctly, if you know how many rows fit per page, but the current page number doesn't update, unless you're using separate run and render, it seems. I've tried several different ways to try to get something to work, with no luck. If I find something, I'll let you know.
Sorry Michael, but how could I use the <<separate run and render tasks>> ?
|
|
|
|
Re: Page Number and pageTotal problem [message #1033672 is a reply to message #1017395] |
Thu, 04 April 2013 10:01   |
Eclipse User |
|
|
|
Hi Michael,
i insert this element in one cell on my table header
<cell id="68">
<auto-text name="totP" id="67">
<property name="type">total-page</property>
</auto-text>
</cell>
and, in another cell, i insert a text field with these scripts:
1) onrender
var pageN= reportContext.getPersistentGlobalVariable("pageN");
if (pageN==null){
pageN=0;
}
pageN= (pageN*1)+1;
reportContext.setPersistentGlobalVariable("pageN",pageN.toString());
this.text=pageN;
2) onpagebreak
var pageN= reportContext.getPersistentGlobalVariable("pageN");
pageN= (pageN*1)+1;
reportContext.setPersistentGlobalVariable("pageN",pageN.toString());
this.text=pageN;
it's work, infact i see correctly the two values in each page.
But, as final step, i would concatenate this values, so i modify my script of onpagebreak in this way (the first 3 rows):
importPackage( Packages.org.eclipse.birt.report.model.api);
elementFactory = reportContext.getDesignHandle().getElementFactory()
var totp = reportContext.getDesignHandle().findElement("totP");
[...]
var pageN= reportContext.getPersistentGlobalVariable("pageN");
pageN= (pageN*1)+1;
reportContext.setPersistentGlobalVariable("pageN",pageN.toString());
this.text=pageN;
how can i get a value of totp AutoTextHandle element?
Thanks in advance
[Updated on: Thu, 04 April 2013 10:01] by Moderator
|
|
|
Re: Page Number and pageTotal problem in BIRT Layout [message #1405357 is a reply to message #1016569] |
Thu, 07 August 2014 03:03  |
Eclipse User |
|
|
|
Hi,
How to get Pagenumbers with total page count in BIRT Layout(Not in MasterPage). Example: Page 1 of 5, 2 of 5 etc.
I used the following snippet:
<viewtime-value-of>pageNumber</viewtime-value-of>of<viewtime-value-of>totalPage</viewtime-value-of>
But this is showing as follows:
1 of 1
2 of 2
3 of 3.
Plz suggest me how to proceed.
Thanks in Advance.
|
|
|
Powered by
FUDForum. Page generated in 0.09905 seconds