Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
combining groups based on number of items in the group, pojo datasource
yaragallamurali
<p>Hi the following is my pojo</p>
<pre class="_prettyXprint _lang-nocode">
public class Book{
private String bookName;
private String price;
private String author;
}</pre>
<p>My report contains list of books. but the books are grouped on "author". I have given a page break after each group. now if the group contains less than 5 books 2 groups should appear on the same page.</p>
<p>How can i achieve this? That means the page break should be applied after 2 groups if the group contains less than 5 books. please kindly help me.</p>
Find more posts tagged with
Comments
mwilliams
Do you need to know that both groups contain less than 5 books? Or just the first group on the page?
yaragallamurali
<p>Any two groups that contains less than 5 books should appear on a single page. Both groups should contain less than 5 books.</p>
yaragallamurali
<p>Any help will be appreciated. Thanking you so much.</p>
mwilliams
I think you could maintain a record count in script that you reset in onPageStart. Then, you handle page breaking manually in script. You'd also need to keep a page group count to be sure you break after two groups no matter what. You'd just need to get the number of books in the first group. If less than 5, you'd not set the pageBreakAfter property. If more, you'd set it. On the second group, if there were more than 5, you'd set the pageBreakBefore, otherwise, you'd set the pageBreakAfter. Hope this helps. If you provide the POJO jar and a design, I could help modify it for you, if you have troubles.