Jump to content
Changes to the Jaspersoft community edition download ×

Problem with grouping


Recommended Posts


I have a problem displaying all the records based on portfolio ID. Its generates 1 page report with 3 records. But there are 3 portfolio id's with 13, 7, 2 records in the xml file.



If I use <groupExpression><![CDATA[$V{REPORT_COUNT}]]></groupExpression>

It prints me all the records but then they are not grouped by.


If I use isStartNewPage="true" it prints me only one record per page and the rest of the space in each page is blank.



Below is my <group> tag



<group name="DetailGroup" isStartNewPage="true">
<band height="8" >
<subreport isUsingCache="true">
<subreportParameter name="PortfolioID">
<subreportParameter name="TransactionCode">
<subreportParameter name="XML_DATA_DOCUMENT">
<returnValue subreportVariable="REPORT_COUNT" toVariable="TradeCount" calculation="Sum"/>
<subreportExpression class="java.lang.String"><![CDATA["C:\projects\format1_head_info.jasper"]]></subreportExpression>
<band height="0" isSplitAllowed="true" >


Is this an expected behaviour? Actually I need the report in this way.


Each page can display upto 4 records and there are 22 total records in the xml file linked to 3 portfolio ID's.


So, for 1st portfolio id (13 records) it will be till 4th page.

2nd portfolio id(7 records) will start from 5th page to 6th page.

3rd portfolio id(2 records) will start from 7th page and end at 7th page


Can someone throw light on me please?



Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I guess you should make two groups (don't know exactly if it will work within just one).


first group is for field "$F{PortfolioID}"


Second group should go for variable $V{REPORT_COUNT} where you should divide by 4 where the rest is 0 (the MOD division) with StartAtNewPage Attribute = true.


(search the forum for "limit records per page" .. I remember having read this some days/weeks/month ago)


If this work you could try to merge these groups with an logical AND ( && ). Perhaps this works also.


Never tried, just my thoughts.




Post edited by: CBox, at: 2006/10/23 11:48

Link to comment
Share on other sites

  • 2 weeks later...

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