Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Page number and total page
Page number and total page [message #774451] Tue, 03 January 2012 18:52 Go to next message
Jason Nguyen is currently offline Jason Nguyen
Messages: 7
Registered: January 2012
Junior Member
I have a requirement to add page number and total page to the report directly, which is a form. I copy and paste those 2 fields from master page over the report. The total page shows the correct value; however, the current page always shows a value of one. Is there anything I need to setup to get it working correctly?
Thanks,
Re: Page number and total page [message #774831 is a reply to message #774451] Wed, 04 January 2012 13:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you use a text element and set its type to html and put in the
following expression:

<viewtime-value-of>
pageNumber
</viewtime-value-of>

Jason

On 1/3/2012 6:52 PM, Jason Nguyen wrote:
> I have a requirement to add page number and total page to the report
> directly, which is a form. I copy and paste those 2 fields from master
> page over the report. The total page shows the correct value; however,
> the current page always shows a value of one. Is there anything I need
> to setup to get it working correctly?
> Thanks,


Jason Weathersby

BIRT Exchange
Re: Page number and total page [message #774864 is a reply to message #774831] Wed, 04 January 2012 15:01 Go to previous messageGo to next message
Jason Nguyen is currently offline Jason Nguyen
Messages: 7
Registered: January 2012
Junior Member
I did exactly what you said and I see the "pageNumber", not the numerical page number value.
Re: Page number and total page [message #774882 is a reply to message #774864] Wed, 04 January 2012 15:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Did you set the type to html? What version of BIRT are you using?

On 1/4/2012 3:01 PM, Jason Nguyen wrote:
> I did exactly what you said and I see the "pageNumber", not the
> numerical page number value.


Jason Weathersby

BIRT Exchange
Re: Page number and total page [message #774888 is a reply to message #774882] Wed, 04 January 2012 16:10 Go to previous messageGo to next message
Jason Nguyen is currently offline Jason Nguyen
Messages: 7
Registered: January 2012
Junior Member
Version 2.3.2. Yes, I set it to HTML.
Re: Page number and total page [message #774894 is a reply to message #774888] Wed, 04 January 2012 16:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Sorry,

View-Time value of was not available until BIRT 2.6. I am not certain
if <VALUE-OF>pageNumber</VALUE-OF> will work but you could give it a try.

Jason


On 1/4/2012 4:10 PM, Jason Nguyen wrote:
> Version 2.3.2. Yes, I set it to HTML.


Jason Weathersby

BIRT Exchange
Re: Page number and total page [message #774902 is a reply to message #774894] Wed, 04 January 2012 17:00 Go to previous messageGo to next message
Jason Nguyen is currently offline Jason Nguyen
Messages: 7
Registered: January 2012
Junior Member
After I changed to <VALUE-OF>pageNumber</VALUE-OF>
I get 1's in all the header pages of the form. Is pageNumber a reserved name in Birt? Is it tied to a particular field at all? How does that variable get incremented in Birt? Thanks.
Re: Page number and total page [message #774935 is a reply to message #774902] Wed, 04 January 2012 19:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

pageNumber is a reserved name but works on the layout in later versions
of BIRT. It has to be viewed using the frameset mapping (separate run
and render task). This is where the variable gets incremented.

Jason

On 1/4/2012 5:00 PM, Jason Nguyen wrote:
> After I changed to <VALUE-OF>pageNumber</VALUE-OF>
> I get 1's in all the header pages of the form. Is pageNumber a reserved
> name in Birt? Is it tied to a particular field at all? How does that
> variable get incremented in Birt? Thanks.


Jason Weathersby

BIRT Exchange
Re: Page number and total page [message #775227 is a reply to message #774935] Thu, 05 January 2012 10:42 Go to previous messageGo to next message
Jason Nguyen is currently offline Jason Nguyen
Messages: 7
Registered: January 2012
Junior Member
Are you saying version 2.3.2 has a bug that pagenumber is not working? Is there a way that I can get around this bug?
Re: Page number and total page [message #775283 is a reply to message #775227] Thu, 05 January 2012 13:03 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

How are you viewing the report? With the web viewer using the frameset
mapping?

Jason

On 1/5/2012 10:42 AM, Jason Nguyen wrote:
> Are you saying version 2.3.2 has a bug that pagenumber is not working?
> Is there a way that I can get around this bug?


Jason Weathersby

BIRT Exchange
Re: Page number and total page [message #775316 is a reply to message #775283] Thu, 05 January 2012 13:59 Go to previous messageGo to next message
Jason Nguyen is currently offline Jason Nguyen
Messages: 7
Registered: January 2012
Junior Member
I am viewing the report in pdf. Do you have a sample code somewhere? What version of Birt the pageNumber is working properly?
Re: Page number and total page [message #775322 is a reply to message #775316] Thu, 05 January 2012 14:07 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I am attaching a 3.7 report. Look at the green field. BTW in the
designer it does not work correctly when previewing directly to pdf. I
first preview in the web viewer and then export to pdf and it works.
This is because view in pdf uses a runandrender task as opposed to run
task then a separate render task. Page scripts have to have separate tasks.

Jason

On 1/5/2012 1:59 PM, Jason Nguyen wrote:
> I am viewing the report in pdf. Do you have a sample code somewhere?
> What version of Birt the pageNumber is working properly?


Jason Weathersby

BIRT Exchange
Previous Topic:How to change the name of the database for a datasource dynamically?
Next Topic:trouble sorting with joint data sets
Goto Forum:
  


Current Time: Tue May 21 22:35:30 EDT 2013

Powered by FUDForum. Page generated in 0.02020 seconds