Detail band longer than necessary in iReport

ireportjasper-reportspdf-generation

I have a detail band with text fields and a table. In the designer view I have fit all the band, but when I see the preview the lowest text field is higher than the first text field in the next band (i.e. I have empty space between band 1 and band 2).

The empty space is due by the table, in fact if I remove it I have no empty space. Below the designer view and preview.

Designer view

Preview

The question is: how I can avoid the empty space between the bands? Thanks.

Best Answer

EDIT2: Now that the report is shown, it's clear. Make the table bigger in the report layout. Stretch it all the way to the bottom. When you don't, JR is careful to include as much space below it as you have left there.

EDIT: I think the key issue is that the band height should be "20" to match the height of the elements in it.

Old answer containing trivia that might or might not matter:
Some of your "text fields" are textFields. This is good. Some of your "text fields" are staticText. This is bad. Convert the static text to real text fields. You can right-click them and automatically transform them.

stretchType is bad. Turn that off. (Actually, it's good and useful... but it's not what you want.)

isStretchWithOverflow is good. Turn it on. Your text says that it's already on, but your code shows that it is not.

isPrintWhenDetailOverflows is bad. Turn it off. Your text makes no mention of it, but your code shows that it is on. (It's probably irrelevant... but you should turn it off to be clear that it's not what you think it is.)

Related Topic