Jump to content
We've recently updated our Privacy Statement, available here ×

Need help in changing report page on certain circumstances in Jaspersoft Studio


Recommended Posts

Hello. I have a case that may require help here. Let's consider that I have two parameters

TYPENAME
AName 1
BName 2
CName 3
AName 4
DName 5
EName 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.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

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>[/code]

 

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