mathewrond Posted October 23, 2006 Share Posted October 23, 2006 Hi,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 Code:<group name="DetailGroup" isStartNewPage="true"> <groupExpression><![CDATA[$F{PortfolioID}]]></groupExpression> <groupHeader> <band height="8" > <subreport isUsingCache="true"> <reportElement x="0" y="0" width="721" height="8" forecolor="#FFFFFF" key="subreport2" positionType="Float"/> <subreportParameter name="PortfolioID"> <subreportParameterExpression><![CDATA[$F{PortfolioID}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="TransactionCode"> <subreportParameterExpression><![CDATA[$F{TransactionCode}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="XML_DATA_DOCUMENT"> <subreportParameterExpression><![CDATA[$P{XML_DATA_DOCUMENT}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <returnValue subreportVariable="REPORT_COUNT" toVariable="TradeCount" calculation="Sum"/> <subreportExpression class="java.lang.String"><![CDATA["C:\projects\format1_head_info.jasper"]]></subreportExpression> </subreport> </band> </groupHeader> <groupFooter> <band height="0" isSplitAllowed="true" > </band> </groupFooter></group> 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? Mathew Link to comment Share on other sites More sharing options...
C-Box Posted October 23, 2006 Share Posted October 23, 2006 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. hthC-BoxPost edited by: CBox, at: 2006/10/23 11:48 Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted October 23, 2006 Share Posted October 23, 2006 Can you post the report? Are you putting the fields in the headers as opposed to the detail band by chance? HTH,Robin Link to comment Share on other sites More sharing options...
mathewrond Posted October 23, 2006 Author Share Posted October 23, 2006 Solved by changing xpath query Post edited by: mathewrond, at: 2006/11/03 06:45 Link to comment Share on other sites More sharing options...
mathewrond Posted October 24, 2006 Author Share Posted October 24, 2006 Any one? Link to comment Share on other sites More sharing options...
Teodor Danciu Posted November 1, 2006 Share Posted November 1, 2006 Hi, I'm not sure why you use a subreport.And you did not provide the subreport template, which make it difficult to understand why the subreport does not work. What C-Box suggested should work. I don't think you need a subreport. Thank you,Teodor 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