Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Page Number and pageTotal problem
Page Number and pageTotal problem [message #1016569] Wed, 06 March 2013 23:29 Go to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
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 #1016603 is a reply to message #1016569] Thu, 07 March 2013 06:12 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

What is your BIRT version? Any way you can recreate your issue using the sample database, so I can see what your setup is? Thanks.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1016702 is a reply to message #1016603] Thu, 07 March 2013 12:26 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Hi Michael,
i attached file (modified) that you sent me for my other problem groups.
In the Header i put 3 ways in which i take the number of page and number of total page.
I use the latest version of birt viewer 4.2.2.
Thanks in advance for your help

[Updated on: Thu, 07 March 2013 12:27]

Report message to a moderator

Re: Page Number and pageTotal problem [message #1016893 is a reply to message #1016702] Fri, 08 March 2013 05:57 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

I don't see anything having to do with pageNumbers in the attached report. Can you double check that you uploaded the correct one and let me know? Thanks!

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1016934 is a reply to message #1016893] Fri, 08 March 2013 09:23 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Rolling Eyes OPS !! Rolling Eyes
I upload your old file, these are the correct files....sorry


Re: Page Number and pageTotal problem [message #1017085 is a reply to message #1016934] Fri, 08 March 2013 21:51 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1017147 is a reply to message #1017085] Sat, 09 March 2013 21:41 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Hi Michael,
with frameset works, i use this url:
http://localhost:8082/birt4/frameset?__format=PDF&__report=.....

but i would use this url:
http://localhost:8082/birt4/run?__format=PDF&__report=.....

I tested my report with first kind of url, but the behavior of the layout is different, so for me it is very important to use the second type of url to not lose all the job done.
I did not understand if with the first type of url i get the same result and, if so, i have not understand how use it.
Thanks

[Updated on: Sat, 09 March 2013 22:04]

Report message to a moderator

Re: Page Number and pageTotal problem [message #1017157 is a reply to message #1017147] Sun, 10 March 2013 04:50 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1017180 is a reply to message #1017157] Sun, 10 March 2013 18:27 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Hi Michael,
the layout is different becouse i design complex structure in which i the height so that the layout came into a A4, with the "run" is ok but with the "frameset" my layout is on 2 pages.
Maybe I have to find an alternative way, like take the values ​​from masterpage for display in my header table.
Thanks

Re: Page Number and pageTotal problem [message #1017182 is a reply to message #1017180] Sun, 10 March 2013 19:18 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

And using the masterpage auto-text, which works, is not an option?

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1017268 is a reply to message #1017182] Mon, 11 March 2013 12:00 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
I can't use the header of the master page because the data <page of Page> must be present in the table header.
Re: Page Number and pageTotal problem [message #1017333 is a reply to message #1017268] Mon, 11 March 2013 15:55 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1017377 is a reply to message #1017333] Mon, 11 March 2013 17:47 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
Michael Williams wrote on 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.

Sorry Michael, but how could I use the <<separate run and render tasks>> ?
Re: Page Number and pageTotal problem [message #1017395 is a reply to message #1017377] Mon, 11 March 2013 18:34 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1687
Registered: July 2009
Senior Member

Sorry. By URL, that's using the frameset option. From java, there are separate tasks: Run, Render, and runAndRender.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page Number and pageTotal problem [message #1033672 is a reply to message #1017395] Thu, 04 April 2013 14:01 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
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

Re: Page Number and pageTotal problem in BIRT Layout [message #1405357 is a reply to message #1016569] Thu, 07 August 2014 07:03 Go to previous message
raghu mannava is currently offline raghu mannavaFriend
Messages: 1
Registered: August 2014
Junior Member
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.
Previous Topic:How to fetch Font from IAutoText and set to IText Paragraph
Next Topic:Birt Report 3.2.22 fails in 4.3
Goto Forum:
  


Current Time: Sat Dec 20 06:35:25 GMT 2014

Powered by FUDForum. Page generated in 0.02475 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software