How can I have a header for each detail band?

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

Hi i want to create in Jaspersoft Studio the following report:

<Column Header1>
<Detail1>
<Column Footer1>

<Column Header2>
<Detail2>
<Column Footer2>

<Column Header3>
<Detail3>
<Column Footer3>

And i dont know how to realise it. 

What i can do: 
<Column Header>
<Detail1>
<Detail2>
<Detail3>
<Column Footer>

And thats not what i like. I read in the forum somebody else had a similar issue and the answer was to create groups.
But somehow it doesn't work the way i want or i do something wrong. The result i get with groups:
<Column Header>
<Group1 Header>
<Group2 Header>
<Group3 Header>
<Detail1>
<Detail2>
<Detail3>
<Group3 Footer>
...



How can i realise it? I hope somebody can help me.

as_9's picture
277
Joined: Jan 11 2016 - 5:35am
Last seen: 3 years 2 months ago

5 Answers:

Try to create a single group, not 3, which breaks every record.
Add 3 different bands in the group header section, each one having its own Print When Expression, in order to print them only for their related record.
The same way, add 3 bands with Print When Expression in the group footer section.

shertage's picture
11814
Joined: Sep 26 2006 - 8:06pm
Last seen: 2 weeks 3 days ago

Hi, thx for the answer.
i have now:
 

<Group1 Group Header 1>
<G1 gH 2>
<G1 gH3>
<Detail 1>
<Detail 2>
<Detail 3>

Is this the right way? 
What do I have to write in the printwhen expression, so than h1 is printed over detail 1 and h2 over detail2?

as_9's picture
277
Joined: Jan 11 2016 - 5:35am
Last seen: 3 years 2 months ago

Your group should break every record. The group expression should be something like:

$V{Group1_COUNT} <= 1

Print When Expressions:

  • for Group Header 1: $V{REPORT_COUNT} == 0
  • for gH 2: $V{REPORT_COUNT} == 1
  • for gH 3: $V{REPORT_COUNT} == 2
  • for Group Footer 1: $V{REPORT_COUNT} == 1
  • for gF 2: $V{REPORT_COUNT} == 2
  • for gF 3: $V{REPORT_COUNT} == 3
shertage's picture
11814
Joined: Sep 26 2006 - 8:06pm
Last seen: 2 weeks 3 days ago

"Your group should break every record." -> i m not sure where to set this up.
In the group properties i have: name, expression, min height, min details, start new column, start new page, reprint heder on each page, reset page number, keep together, prevent orphan footer, footer position, layouts, height, split type, print when expression.

as_9's picture
277
Joined: Jan 11 2016 - 5:35am
Last seen: 3 years 2 months ago

There is no need to set a special property for the group. By putting the $V{Group1_COUNT} <= 1 condition in the Group Properties --> Expression, the group will break after every individual record, each record being decorated with its own group header and footer.

shertage's picture
11814
Joined: Sep 26 2006 - 8:06pm
Last seen: 2 weeks 3 days ago
Feedback
randomness