Jump to content
Changes to the Jaspersoft community edition download ×

Problem with alternate colours

2005 IR Help

Recommended Posts

By: David Lim - aberrant80

Problem with alternate colours

2004-03-18 04:49

I think I know what's wrong but maybe I'm wrong.


I was trying to create a table with alternate row colours. I had to let the detail band text fields stretch by themselves so I can only do detailBand.setHeight(1). And I created an element group containing 2 rectangles, both also with height 1 and set to stretch relative to tallest element, and correctly set with the printWhenExpression and colours.


The problem is that when the report is actually generated, it appears that one of the rectangles stretched more than other, as on all the pages (except the last). Hard to describe.


Odd colour: grey

Even colour: white


Page 1: alternate colouring correct, but at bottom of table, a single line of grey appeared at bottom of last white row.


Page 2: first 2 rows in white, then alternate colouring correct, then another single grey line at bottom of the last row (which is white again).


Subsequent pages: all similar to page 2.


Last page: similar to page 2, except no extra grey line.


I wonder what could have happened?





By: Teodor Danciu - teodord

RE: Problem with alternate colours

2004-03-18 10:51




I suspect that the bottom gray line that appears is in

fact your odd color rectangle.

Being so small (1 pixel tall) it actually fits there

where no other text element would fit and gets

printed alone in the remaining space on the current

page, all the other elements getting posteponed

to the next page.


If so, a solution would be to force the band not

to split using isSplitAllowed="false".


I hope this helps.







By: David Lim - aberrant80

RE: Problem with alternate colours

2004-03-18 17:56

It works! thanks!!!

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