Evaluation time of expressions

Hi all!

I've got a question about eval times and bands...

I defined two bands in a report representing even and odd to realize a switch between to different background colours of lines of a table (both bands containing the same text fields but different background colurs). To realize the switch I use "print when expression", e.g. for the evenband

$V{PAGE_COUNT}.intValue() % 2 == 0 ? Boolean.TRUE : Boolean.FALSE

and for the odd band

$V{PAGE_COUNT}.intValue() % 2 == 1 ? Boolean.TRUE : Boolean.FALSE

It works fine for the first page of the report, but not on the following pages - all of the following pages contains the first two lines marked as odd although the value of the first row $V{PAGE_COUNT} is 0 and of the second row is 1, third is 2 and so on...

Could it be possible, that the evalution times are different? What's the matter?

Thanks in advance!

Thomas
tschuler's picture
Joined: Jul 17 2006 - 9:32pm
Last seen: 17 years 2 months ago

4 Answers:

You can have the same effect using a conditional style for the same element.

Try to use REPORT_COUNT instead of PAGE_COUNT as testing variable.


Giulio
giulio's picture
74129
Joined: Jan 2 2007 - 4:15pm
Last seen: 3 days 7 hours ago
Hi Giulio!

Thanks for the quick answer - but it won't help me. Unfortunately the phenomenon doesn't occur if the number of lines in the report page is even. If it's odd - then the expression for the even band will be evaluated to even...

See the attached PDFs for more details...the column NAME contains REPORT_COUNT and PAGE_COUNT - the first file contains a pagefooter and this causes with given dimensions that the number of lines is even. If the footer is removed that number of lines is odd (one more) and this causes the problem...

Thomas
Post edited by: tschuler, at: 2007/03/01 08:53
tschuler's picture
Joined: Jul 17 2006 - 9:32pm
Last seen: 17 years 2 months ago

Post edited by: tschuler, at: 2006/08/09 07:57
tschuler's picture
Joined: Jul 17 2006 - 9:32pm
Last seen: 17 years 2 months ago
See this file attached contains the problem beginning on page 2...
Post edited by: tschuler, at: 2007/03/01 08:54
tschuler's picture
Joined: Jul 17 2006 - 9:32pm
Last seen: 17 years 2 months ago
Feedback
randomness