kristian.wijaya123 Posted May 2, 2017 Share Posted May 2, 2017 Hello. I have a case that may require help here. Let's consider that I have two parametersTYPENAMEAName 1BName 2CName 3AName 4DName 5EName 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 rowIf 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 More sharing options...
andreluis.online Posted May 2, 2017 Share Posted May 2, 2017 if you are working with groups, there is a group property called 'start on a new page'. I haven't try it, but put an expression on it maybe work. Link to comment Share on other sites More sharing options...
kristian.wijaya123 Posted May 4, 2017 Author Share Posted May 4, 2017 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 2Type C Name 3Type A Name 4=====Type D Name 5Type E Name 6While I wanted it to be like:Type A Name 1Type B Name 2Type C Name 3=====Type A Name 4Type D Name 5Type E Name 6 Link to comment Share on other sites More sharing options...
szaharia Posted May 4, 2017 Share Posted May 4, 2017 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 More sharing options...
kristian.wijaya123 Posted May 5, 2017 Author Share Posted May 5, 2017 @shertage This works to an extent. Though I forgot to say an addition. I want the REPORT_COUNT reset when we change page. How do I do that? Link to comment Share on other sites More sharing options...
szaharia Posted May 5, 2017 Share Posted May 5, 2017 Just use $V{PAGE_COUNT} instead. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now