How to fix height of detail band inside table

0

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

devendra.616's picture
Joined: Mar 26 2016 - 4:37am
Last seen: 3 years 6 months ago

2 Answers:

1

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

shertage's picture
1940
Joined: Sep 26 2006 - 8:06pm
Last seen: 3 months 1 week ago
1

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

Attachments: 
AttachmentSize
Binary Data five_rows.jrxml6.65 KB
shertage's picture
1940
Joined: Sep 26 2006 - 8:06pm
Last seen: 3 months 1 week ago
Feedback