Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
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
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
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
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
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
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
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
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
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: 23
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 messageGo to next 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)
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #1575129 is a reply to message #840198] Tue, 20 January 2015 16:45 Go to previous messageGo to next message
Surya Rao is currently offline Surya RaoFriend
Messages: 2
Registered: January 2015
Junior Member
Hi Jason Weathersby,

Tried the way you mentioned it worked but page number gets displayed starting from second page. On first page it shows as empty. Even the example you gave had this issue.

Thanks.
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #1575144 is a reply to message #840198] Tue, 20 January 2015 16:57 Go to previous messageGo to next message
Surya Rao is currently offline Surya RaoFriend
Messages: 2
Registered: January 2015
Junior Member
Hi Jason Weathersby,

I tried the way you mentioned. It prints page number correctly from second page. For first page its blank. Also total pages count is wrong it shows as 1 of 1, 2 of 2, 3 of 3 so on. The example you mentioned also has this issue.

Thanks
Re: How to restart page numbering within a group in BIRT 3.7.1 [message #1746524 is a reply to message #841018] Mon, 31 October 2016 15:04 Go to previous message
yoovraj khullar is currently offline yoovraj khullarFriend
Messages: 7
Registered: November 2014
Junior Member
Hi Jason

I am using this example Of yours , but this is my Issue.
I have to pass as parameter for the group on which i have to reset page number . i.e this param :BOL#s as :C-15-0000001;C-15-0000002;C-16-0084121.

The problem is that the SubShipment O-15-0013451 starts a new paging group.
Master BOL/aka Shipment BOL /aka SubShipment

C-15-0000001 (BOL: MB3653535)
O-15-0013479 (BOL: 7433)
O-15-0013480 (BOL: 7434)
O-15-0013535 (BOL: 7435)
C-15-0000002 (BOL: MB36535355655)
O-15-0013450 (BOL: 7432)
O-15-0012627 (BOL: 7431)
O-15-0013451(BOL: 7431)
C-16-0084121 (BOL: MB300/67)
O-16-0015277 (BOL: BL79995)
O-16-0020009 (BOL: BL79996)
O-16-0040032 (BOL: BL81227)

That problem needs to be fixed.

To elaborate, My report generates 6,3,6 pages for each BOL#s whereas it should generate 6,4,5 pages ,the second Sub Shipment spills(O-15-0013451(BOL: 7431)) over to the 3rd Group.(C-16-0084121 (BOL: MB300/67))
Previous Topic:BIRT Chart: Displaying values which are not in the dataset
Next Topic:Show Parameters on Report Viewer Page!
Goto Forum:
  


Current Time: Fri Apr 19 18:50:26 GMT 2024

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

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

Back to the top