Jump to content
Changes to the Jaspersoft community edition download ×

How to fix height of detail band inside table


devendra.616
Go to solution Solved by szaharia,

Recommended Posts

I have report of 3 tables which are grouped on category. 

If one table has 2 rows for a category and other table has 5 rows then they are not aligned to same height. I want to fix the height of detial band so that it can accomodate maximum 5 rows as my data is of maximum 5 rows of each category. 

or how to print empty rows if no of fetched rows is less than 5

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

Hi,

In case of fixed-height rows you could add other 5 detail bands of the same height in your detail section, each of them populated with empty elements (in order to keep the same layout as in the occupied rows) and each of them having a print when expression (assuming the group name is 'category'):

  • $V{category_COUNT} < 1 - for the first band
  • $V{category_COUNT} < 2 - for the second band
  • $V{category_COUNT} < 3 - for the third band
  • and so on

This solution cannot be applied for rows with variable height, because we don't know the most appropriate height value for the additional bands. In such a case, making use of table component/subreports for each of 3 tables would represent a better approach.

I hope this helps,

Sanda

Link to comment
Share on other sites

Hello,

Here is a more suitable solution for this problem: instead of using multiple detail bands that may affect the output layout, just place a frame in a group footer band. Inside this frame create five rows with empty elements that preserve the same layout as the populated rows and write a proper print when expression for each empty element. Also write a related print when expression for the entire group footer band.

Elements in a frame can be placed beyond its boundaries, and that is an advantage in this case.

Attached is a report sample that can be tested using an empty datasource with 1 or many records.

Regards,

Sanda

Link to comment
Share on other sites

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