Hello. I have a case that may require help here. Let's consider that I have two parameters
TYPE | NAME |
A | Name 1 |
B | Name 2 |
C | Name 3 |
A | Name 4 |
D | Name 5 |
E | Name 6 |
I want it that for the 1st page, it contains types A, B and C. But on the next page, it contains types A, D and E. So basically it checks the type of the row:
- If it's not A, then just add a new row
- If it's A, then they check how many times has it occur in the page:
- If it hasn't occurred in the page, then they add new row. It's always going to be the 1st row.
- If it has occurred in the page, then they create a new page.
How do I set that up for a unique page-change condition? Can't seem to find it in Jaspersoft Studio. Help appreciated. Thanks.
5 Answers:
I've tried 'Start On A New Page'. However, I do not know the proper Group Expression. If I just use group expression on Type, then the result would end up like:
Type A Name 1
=====
Type B Name 2
Type C Name 3
Type A Name 4
=====
Type D Name 5
Type E Name 6
While I wanted it to be like:
Type A Name 1
Type B Name 2
Type C Name 3
=====
Type A Name 4
Type D Name 5
Type E Name 6
You could use a break element placed above the type textfield with a print when expression:
<break> <reportElement x="0" y="0" width="100" height="1"> <printWhenExpression><![CDATA[$V{REPORT_COUNT} > 1 && $F{type}.equals("A")]]></printWhenExpression> </reportElement> </break>