|
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 |
|
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 #841018 is a reply to message #840992] |
Tue, 10 April 2012 20:04 |
|
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 #843027 is a reply to message #842811] |
Thu, 12 April 2012 18:55 |
|
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 |
|
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 |
|
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
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27697 seconds