Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to restart page numbering within a group in BIRT 3.7.1
How to restart page numbering within a group in BIRT 3.7.1 [message #840198] Mon, 09 April 2012 19:49 Go to next message
Aleksey   is currently offline Aleksey Friend
Messages: 42
Registered: April 2012
Member
Hello,
Has somebody tried to restart page numbering per break group key change? For Example, you print purchase orders report and would like to have a separate pagination (e.g. Page N of M) per each purchase order. The page N of M should be printed preferably on a report page header, if not - Table or Group Header. Wonder if someone could point to a simple report design example....

Thanks,
Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #840850 is a reply to message #840198] Tue, 10 April 2012 15:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Here is an example that uses page scripts to do this. Run and Rendering
have to be separate, like using the frameset servlet mapping in the viewer.

Jason

On 4/9/2012 3:49 PM, ivkina Mising name wrote:
> Hello,
> Has somebody tried to restart page numbering per break group key change?
> For Example, you print purchase orders report and would like to have a
> separate pagination (e.g. Page N of M) per each purchase order. The page
> N of M should be printed preferably on a report page header, if not -
> Table or Group Header. Wonder if someone could point to a simple report
> design example....
>
> Thanks,
> Aleksey
>
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #840992 is a reply to message #840850] Tue, 10 April 2012 19:22 Go to previous messageGo to next message
Aleksey   is currently offline Aleksey Friend
Messages: 42
Registered: April 2012
Member
Thanks Jason! I got the idea using Page Variables and AutoText Control. Just to confirm quickly - would that be possible to use Page Variable outside of AutoText control on the Page Header? I could not make it work. I tried adding a regular Data control to the Page Header and setting expression to reportContext.getPageVariable("PAGE_VAR1") but it always returns null. However, if I put AutoText next to this data control and assign PAGE_VAR1 to it in Advanced properties, then it shows the correct value.

Thanks,
Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #841018 is a reply to message #840992] Tue, 10 April 2012 20:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Did you try using a text element with this expression:
<VIEWTIME-VALUE-OF>vars["PAGE_VAR1"]</VIEWTIME-VALUE-OF>

Set its type to html.

Jason

On 4/10/2012 3:22 PM, ivkina Mising name wrote:
> Thanks Jason! I got the idea using Page Variables and AutoText Control.
> Just to confirm quickly - would that be possible to use Page Variable
> outside of AutoText control on the Page Header? I could not make it
> work. I tried adding a regular Data control to the Page Header and
> setting expression to reportContext.getPageVariable("PAGE_VAR1") but it
> always returns null. However, if I put AutoText next to this data
> control and assign PAGE_VAR1 to it in Advanced properties, then it shows
> the correct value.
>
> Thanks,
> Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #841063 is a reply to message #841018] Tue, 10 April 2012 21:33 Go to previous messageGo to next message
Aleksey   is currently offline Aleksey Friend
Messages: 42
Registered: April 2012
Member
it looks like that you can access the Page Vars at view time only. Overriding data control onRender() -> this.setDisplayValue(reportContext.getPageVariable("PAGE_VAR1")); works too.
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #841064 is a reply to message #841063] Tue, 10 April 2012 21:34 Go to previous messageGo to next message
Aleksey   is currently offline Aleksey Friend
Messages: 42
Registered: April 2012
Member
it looks like that you can access the Page Vars at view time only. Overriding data control onRender() -> this.setDisplayValue(reportContext.getPageVariable("PAGE_VAR1")); works too.
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #842811 is a reply to message #841064] Thu, 12 April 2012 16:19 Go to previous messageGo to next message
Aleksey   is currently offline Aleksey Friend
Messages: 42
Registered: April 2012
Member
Jason,
I am observing another issue with using page variables. The page variable always displays the next Break Group key, not the current. Could be a timing issue in my script but I just can't figure that out and the script is very simple - 2 lines of code...

Could you please check a sample report attached? Would really appreciate that...

All it does it sets a global variable on group onCreate(): reportContext.setGlobalVariable("CUST_NUM_VAR", this.getRowData().getColumnValue("CUSTOMERNUMBER"));

and then sets page variable on top report component > pageEnd method: reportContext.setPageVariable("CUST_NUM", reportContext.getGlobalVariable("CUST_NUM_VAR"));

Thanks,
Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #843027 is a reply to message #842811] Thu, 12 April 2012 18:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Aleksey,

Move your on create script to the on page break of the data item that
holds the group value. See modified attached example. Also read over
this section to see the order. Oncreate may actually fire for an item
that does not appear on the page.

http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_4

Jason

On 4/12/2012 12:19 PM, ivkina Mising name wrote:
> Jason,
> I am observing another issue with using page variables. The page variable always displays the next Break Group key, not the current. Could be a timing issue in my script but I just can't figure that out and the script is very simple - 2 lines of code...
>
> Could you please check a sample report attached? Would really appreciate that...
>
> All it does it sets a global variable on group onCreate(): reportContext.setGlobalVariable("CUST_NUM_VAR", this.getRowData().getColumnValue("CUSTOMERNUMBER"));
>
> and then sets page variable on top report component> pageEnd method: reportContext.setPageVariable("CUST_NUM", reportContext.getGlobalVariable("CUST_NUM_VAR"));
>
> Thanks,
> Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #843051 is a reply to message #842811] Thu, 12 April 2012 18:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Aleksey,

Move your on create script to the on page break of the data item that
holds the group value. See modified attached example. Also read over
this section to see the order. Oncreate may actually fire for an item
that does not appear on the page.

http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_4

Jason

On 4/12/2012 12:19 PM, ivkina Mising name wrote:
> Jason,
> I am observing another issue with using page variables. The page variable always displays the next Break Group key, not the current. Could be a timing issue in my script but I just can't figure that out and the script is very simple - 2 lines of code...
>
> Could you please check a sample report attached? Would really appreciate that...
>
> All it does it sets a global variable on group onCreate(): reportContext.setGlobalVariable("CUST_NUM_VAR", this.getRowData().getColumnValue("CUSTOMERNUMBER"));
>
> and then sets page variable on top report component> pageEnd method: reportContext.setPageVariable("CUST_NUM", reportContext.getGlobalVariable("CUST_NUM_VAR"));
>
> Thanks,
> Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #843084 is a reply to message #842811] Thu, 12 April 2012 18:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Aleksey,

Move your on create script to the on page break of the data item that
holds the group value. See modified attached example. Also read over
this section to see the order. Oncreate may actually fire for an item
that does not appear on the page.

http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_4

Jason

On 4/12/2012 12:19 PM, ivkina Mising name wrote:
> Jason,
> I am observing another issue with using page variables. The page variable always displays the next Break Group key, not the current. Could be a timing issue in my script but I just can't figure that out and the script is very simple - 2 lines of code...
>
> Could you please check a sample report attached? Would really appreciate that...
>
> All it does it sets a global variable on group onCreate(): reportContext.setGlobalVariable("CUST_NUM_VAR", this.getRowData().getColumnValue("CUSTOMERNUMBER"));
>
> and then sets page variable on top report component> pageEnd method: reportContext.setPageVariable("CUST_NUM", reportContext.getGlobalVariable("CUST_NUM_VAR"));
>
> Thanks,
> Aleksey
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #1067975 is a reply to message #843084] Thu, 11 July 2013 13:54 Go to previous messageGo to next message
Henning von Bargen is currently offline Henning von BargenFriend
Messages: 22
Registered: May 2011
Junior Member
We are using a PostProcessor for this, as BIRT just isn't good at this.
For more info, see my reply here:

Re: Page number and total page
http://www.eclipse.org/forums/index.php/mv/msg/273065/1067972/#msg_1067972
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #1440259 is a reply to message #840850] Wed, 08 October 2014 06:05 Go to previous messageGo to next message
Julien Helbling is currently offline Julien HelblingFriend
Messages: 1
Registered: October 2014
Junior Member
Hi Jason,

This is an old thread, but I was just wondering if you could join the sample report again to it ? (assuming you still having it somewhere)

Unfortunately the link doesn't seem to be alive anymore ...

Thank you very much.
Julien
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #1451960 is a reply to message #1440259] Fri, 24 October 2014 15:13 Go to previous message
abdeslam lakhouit is currently offline abdeslam lakhouitFriend
Messages: 1
Registered: October 2014
Junior Member
hello,
I tested the PaginatePerGroup report. it works fine with eclipseViewer but it does not work if I generated the report using ReportRunner (
Pagination is not correct)
Previous Topic:Cascading parameters errors
Next Topic:Reading Excel Merged Cells
Goto Forum:
  


Current Time: Sat Dec 20 03:07:40 GMT 2014

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

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