| Page Number and pageTotal problem [message #1016569] |
Wed, 06 March 2013 18:29  |
Mimmo Rossi Messages: 108 Registered: February 2013 |
Senior Member |
|
|
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   |
|
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.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
|
|
|
|
|
| Re: Page Number and pageTotal problem [message #1017333 is a reply to message #1017268] |
Mon, 11 March 2013 11:55   |
|
Without 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.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
| Re: Page Number and pageTotal problem [message #1017377 is a reply to message #1017333] |
Mon, 11 March 2013 13:47   |
Mimmo Rossi Messages: 108 Registered: February 2013 |
Senior Member |
|
|
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  |
Mimmo Rossi Messages: 108 Registered: February 2013 |
Senior Member |
|
|
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] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02428 seconds