Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT Master page(Page Numbering on master page in a birt report )
BIRT Master page [message #503808] Tue, 15 December 2009 21:36 Go to next message
Anwar  is currently offline Anwar Friend
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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #503964 is a reply to message #503844] Wed, 16 December 2009 16:01 Go to previous message
Anwar  is currently offline Anwar Friend
Messages: 2
Registered: December 2009
Junior Member
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
Re: BIRT Master page [message #504016 is a reply to message #503964] Wed, 16 December 2009 15:10 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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
Previous Topic:Anyone use RSA Report Designer for BIRT?
Next Topic:Perform sorting based on user input
Goto Forum:
  


Current Time: Fri Apr 26 19:15:58 GMT 2024

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

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

Back to the top