Jump to content
Changes to the Jaspersoft community edition download ×

I would like to ask the Even Odd problem

2005 IR Help

Recommended Posts

By: Jacky - jacky11287

I would like to ask the Even Odd problem

2004-07-21 00:28

Hi, I have studied the Scriplet example from the demo of JasperReport's release, I noticed that there is the structure like Even Group and Odd Group. When the record is at the even, print it with white background, if it is odd, print it with back background.


But I failed in my case...I got each result prints two times....


I raise a question since I looked at the code of the sample, the Evengroup and Oddgroup expression are $V{REPORT_COUNT}, how does it work??

I guess for each result, the $V{REPORT_COUNT} changes and then it is suit for my case....


I just would like to ask, how can I make it like the one from the sample....



Jacky Chan





By: Vijayan Sampath - vijayan

RE: I would like to ask the Even Odd problem

2004-07-21 00:52

If you check the scriptlet example a bit more closely, more specifically the printWhenExpressions under the groups, u'll notice the expressions


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




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


which display the relevant row and hide the other row as needed.





By: Jacky - jacky11287

RE: I would like to ask the Even Odd problem

2004-07-21 19:05

Ok, Thanks Vijayan...


I got it....


I just focused on the printWhenExpression on the TextFields....Yeap, there is also printWhenExpression for bands....


Thanks you very much...


By the way, I would like to ask, where can I find more JasperReport with Java Programming example~~~???



Jacky Chan

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...