Home » Archived » BIRT » Page Number and pageTotal problem
| | | | |
Re: Page Number and pageTotal problem [message #1017085 is a reply to message #1016934] |
Fri, 08 March 2013 21: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.
Michael
Developer Evangelist, Silanis
|
|
| |
Re: Page Number and pageTotal problem [message #1017157 is a reply to message #1017147] |
Sun, 10 March 2013 04:50 |
|
How is the layout different? If you're wanting the page number within the report layout, like that, you'll have to use the frameset way?
If you're ok with doing the page n of m in your masterpage header, rather than the table header, you can use the auto-text from the palette. This works in the non frameset pdf output.
Michael
Developer Evangelist, Silanis
|
|
| | | |
Re: Page Number and pageTotal problem [message #1017333 is a reply to message #1017268] |
Mon, 11 March 2013 15: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.
Michael
Developer Evangelist, Silanis
|
|
|
Re: Page Number and pageTotal problem [message #1017377 is a reply to message #1017333] |
Mon, 11 March 2013 17:47 |
Mimmo Rossi Messages: 146 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 14:01 |
Mimmo Rossi Messages: 146 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 14:01] Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Thu Sep 26 05:42:43 GMT 2024
Powered by FUDForum. Page generated in 0.04740 seconds
|