BIRT Master page [message #503808] |
Tue, 15 December 2009 21:36 |
Anwar Messages: 2 Registered: December 2009 |
Junior Member |
|
|
Hi,
I want to display a page number on my BIRT report. I have done it by writing the following piece of code on onPageStart event of the master page :
importPackage(Packages.java.lang);
prev = reportContext.getPersistentGlobalVariable("previous");
if( prev == null ){
reportContext.setPageVariable("CurrentPage", 1);
reportContext.setPersistentGlobalVariable("previous", "mp1");
reportContext.setPersistentGlobalVariable("mp1cnt", new Integer(1));
}else{
if( prev == "mp1"){
var cnt = reportContext.getPersistentGlobalVariable("mp1cnt");
cnt++;
reportContext.setPersistentGlobalVariable("mp1cnt", new Integer(cnt));
reportContext.setPageVariable("CurrentPage", cnt);
}else{
reportContext.setPageVariable("CurrentPage", 1);
reportContext.setPersistentGlobalVariable("previous", "mp1");
reportContext.setPersistentGlobalVariable("mp1cnt", new Integer(1));
}
}
*****
I have initialised the page varaible to 0. But there are two problems with it -
1. If I open the report as .ppt the page valiable starts with 0. And if I open it with report viewer it starts with 1. How to synch both these outputs.
2. If the table I am loading is too long to fit in a page it goes to the next page of the report but the page no(page variable) doesn't increment in this case.
Could someone please suggest a solution to these problems.
Thanks & Regards
Anwar
|
|
|
Re: BIRT Master page [message #503844 is a reply to message #503808] |
Wed, 16 December 2009 00:00 |
|
Anwar,
Any chance you could take sample db and create the report, so we can
help you with the issue?
Keep in mind page breaks are based on html not the ppt emitter. Set the
page break interval small enough where you will not have overrun. Also
Are you running directly to ppt or exporting to ppt from html?
Jason
Anwar wrote:
> Hi,
> I want to display a page number on my BIRT report. I have done it by
> writing the following piece of code on onPageStart event of the master
> page :
> importPackage(Packages.java.lang);
> prev = reportContext.getPersistentGlobalVariable("previous");
> if( prev == null ){
> reportContext.setPageVariable("CurrentPage", 1);
> reportContext.setPersistentGlobalVariable("previous", "mp1");
> reportContext.setPersistentGlobalVariable("mp1cnt", new Integer(1));
> }else{
> if( prev == "mp1"){
> var cnt = reportContext.getPersistentGlobalVariable("mp1cnt");
> cnt++;
> reportContext.setPersistentGlobalVariable("mp1cnt", new Integer(cnt));
> reportContext.setPageVariable("CurrentPage", cnt); }else{
> reportContext.setPageVariable("CurrentPage", 1);
> reportContext.setPersistentGlobalVariable("previous", "mp1");
> reportContext.setPersistentGlobalVariable("mp1cnt", new Integer(1));
>
> }
> }
>
> *****
>
> I have initialised the page varaible to 0. But there are two problems
> with it -
>
> 1. If I open the report as .ppt the page valiable starts with 0. And if
> I open it with report viewer it starts with 1. How to synch both these
> outputs.
>
> 2. If the table I am loading is too long to fit in a page it goes to the
> next page of the report but the page no(page variable) doesn't increment
> in this case.
>
> Could someone please suggest a solution to these problems.
>
> Thanks & Regards
> Anwar
|
|
|
|
Re: BIRT Master page [message #504016 is a reply to message #503964] |
Wed, 16 December 2009 15:10 |
|
Anwar,
Could you zip it and send to my email? jasonweathersby at windsteam dot
net ?
Jason
Anwar wrote:
> Hi,
>
> Attached is the report created with the sample database.
>
> Could you please help mwith the issue.
>
> I am running directly to PPT.
>
> Regards,
> Anwar
|
|
|
Powered by
FUDForum. Page generated in 0.03468 seconds