Jump to content
JasperReports Library 7.0 is now available ×

Buggy Variable PAGE_COUNT ??


2004 IR Help

Recommended Posts

By: Thomas Richter - hornet_f4c

Buggy Variable PAGE_COUNT ??

2003-02-06 11:19

Hi there - after quite a while it's me again with a small problem.

 

In my report I try to output the page number at the bottom of the page in the format of e.g. "Page 1 of 1".

I was hoping for the code :

"Page " + $V{PAGE_NUMBER} + " of "+ $V{PAGE_COUNT}

to accomplish this. However, while the PAGE_NUMBER variable seems to be correct, the PAGE_COUNT variable seem to have always the same value as the REPORT_COUNT variable which is used somewhere else and is supposed to count the number of records in my report.

 

So e.g. when I have three datasets on one page, the PAGE_COUNT variable has a value of 3 and as such on the bottom appears "Page 1 of 3" - eventhough there is only one page.

 

All the variables I am talking about here are standart variables provided by Jasper Reports and are not explicit declared in the xml.

 

I am using jasper reports v0.4.3 - maybe you can help me over this.

 

Thanx in advance

 

 

 

 

By: Thomas Richter - hornet_f4c

RE: Buggy Variable PAGE_COUNT ??

2003-02-11 19:28

Hum - as you can see from my above code snippet, I am using exactly the both variables you suggest.

However, "selecting the Evaluation Time of the variables" seems to be a good idea. But it seems I have no idea how to it. Usually I set the resetTime when declaring a variable, but since these are already declared I have no idea how to change Eval Times whatsoever. Also I do not seem to find the approproate part of the documentation you tried pointing me to. So maybe you could get me a bit futher in how to "select Eval Times" or just provide a link of the appropriate part of the documentation.

 

Thanks in advance.

 

 

 

 

 

By: Thomas Richter - hornet_f4c

RE: Buggy Variable PAGE_COUNT ??

2003-02-12 08:10

Just found it here:

http://jasperreports.sourceforge.net/tips.tricks.html#pagenumber

 

But now I do understand even less than before.... In this example the variable PAGE_COUNT (as suggested by you and as used by me) is NOT used. Instead ONLY PAGE_NUMBER is used.... in two different textfields with different evaltimes, though.

I understand that would be the way to go if there would be only the variable PAGE_NUMBER available, but since we have PAGE_COUNT, too it should be possible to use them both in one textfield, shouldn't it ?

 

Anyway - what's the purpose of the variable PAGE_COUNT then ? I mean it still seems to have the same value as REPORT_COUNT....all this seems not to add up for me.

Additionally - whats the correct way to display the pagenumber in the format x of y ? Do I really have to use two textfields and if so, should I use the PAGE_COUNT variable for the sum of all pages as suggested here or should I use the PAGE_NUMBER variable for both values ?

 

Thanx in advance

 

 

 

 

 

 

 

 

By: Cesar A. Correia - cesarac

RE: Buggy Variable PAGE_COUNT ??

2003-02-12 08:33

Excuse-me, Thomas. Both variables are PAGE_NUMBER. The difference is the Time Evaluation. The example can be viewed here:

 

http://jasperreports.sourceforge.net/tips.tricks.html#pagenumber

 

 

 

 

By: Ulf Heyder - olpp

RE: Buggy Variable PAGE_COUNT ??

2003-02-12 13:16

1. As far as I know the Variable PAGE_COUNT counts the datarows on the actual page rather than the pages itself.

 

2. Like several others already mentioned you use 2 different textFields with evaluationTime "page" and "report" to create the "page 1 of 5".

 

Like you may read in my posting from 2003-02-11 09:54 I have a formatting (spacing) problem with this page info block aligned to the right margin. Maybe you have an answer to that question.

 

Cheers, Ulf

 

 

 

 

By: Thomas Richter - hornet_f4c

RE: Buggy Variable PAGE_COUNT ??

2003-02-13 15:07

Ok, thanx. I think I got it working and now I even understand, what's the variable pagecount for....counting the dataentries....still this is already done by "reportcount" so this isn't fully clear yet. However, my problem is solved - thanx a bunch guys.

 

Ulf, I left you a message in your thread, but I am afrain I was not too helpful. At least I bumped it back to top :)

 

So thanx again,

Cya

 

 

 

 

By: Ulf Heyder - olpp

RE: Buggy Variable PAGE_COUNT ??

2003-02-14 14:24

Pagecount countsthe number of dataentries on every individual page, report_count counts them for the whole report.

 

Ulf

 

 

 

 

By: Cesar A. Correia - cesarac

RE: Buggy Variable PAGE_COUNT ??

2003-02-07 10:20

You must be use two fields:

- one to "Page " + $V{PAGE_NUMBER} + " of "

- and other to $V{PAGE_COUNT}

 

On first you select Evaluation Time to "Page" and on second select "Report".

 

Look "Tips and tricks" in project docs home page.

 

 

 

 

By: Hathfuri - hathfuri

RE: Buggy Variable PAGE_COUNT ??

2005-01-19 13:16

I believe the expression cesarac was shooting for was:

 

You must be use two fields:

- one to "Page " + $V{PAGE_NUMBER} + " of "

- and other to $V{PAGE_NUMBER}

 

$V{PAGE_COUNT} returns the number of records for that result set.

 

The different evaluation times are needed. Although I am trying to come up with a solution to that if anyone has any ideas that would be great.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...