crazyzai0123 Posted September 13, 2017 Share Posted September 13, 2017 Hi , im new to jasper report , i wish to know is it possible that :Group 1 having 3 pagegroup 1 having 1 pageI want to display:Group 1 : Page 1 of 3, Page 2 of 3, Page 3 of 3Group 2 : Page 1of 1.Possible to do this with jasper report ? Source:<queryString language="SQL"> <![CDATA[select * from Persons where ID = $P{ID}]]></queryString><field name="ID" class="java.lang.Object"/><group name="myGroup" isStartNewPage="true" isResetPageNumber="true"> <groupHeader> <band height="224"> <subreport> <reportElement x="300" y="135" width="270" height="60" uuid="1f20858d-c055-41e2-9a60-bbc040ae6485"/> <subreportParameter name="ID_PERSON"> <subreportParameterExpression><![CDATA[$F{ID}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["subreport_1.jasper"]]></subreportExpression> </subreport> <staticText> <reportElement x="280" y="10" width="100" height="30" uuid="dacdfcd9-150b-419d-ba3b-b56949cd518d"/> <text><![CDATA[Group 1]]></text> </staticText> <break> <reportElement x="0" y="210" width="99" height="1" uuid="a77bf8e0-98ea-4167-b852-f2cb5f6e1cf6"/> </break> <staticText> <reportElement x="280" y="58" width="300" height="30" uuid="df9536c9-6584-43b3-b8b9-45fd0c0b95a6"/> <text><![CDATA[This report is to testing the grouping.]]></text> </staticText> <break> <reportElement x="0" y="111" width="100" height="1" uuid="6cda26ee-6e49-4e94-8d58-5d5dd42745e6"/> </break> </band> </groupHeader> <groupFooter> <band height="50"/> </groupFooter></group><group name="myGroup2" isStartNewPage="true" isResetPageNumber="true"> <groupHeader> <band height="130"> <subreport> <reportElement x="270" y="60" width="300" height="60" uuid="5663a0dc-9b14-485b-84a9-21b5e0c3b98d"/> <subreportParameter name="ID_PERSON"> <subreportParameterExpression><![CDATA[$F{ID}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["subreport_2.jasper"]]></subreportExpression> </subreport> <staticText> <reportElement x="280" y="20" width="100" height="30" uuid="eaa5ee0f-c0e5-4555-b321-a4db52b4efde"/> <text><![CDATA[Group 2]]></text> </staticText> </band> </groupHeader> <groupFooter> <band height="58"/> </groupFooter></group><pageFooter> <band height="57" splitType="Stretch"> <textField evaluationTime="Group" evaluationGroup="myGroup"> <reportElement x="400" y="10" width="100" height="30" uuid="215676d9-e972-45bd-adad-b79c1fa27112"/> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField> <reportElement x="310" y="10" width="110" height="30" uuid="75a82ec2-a8ed-46dd-b5a1-147c450e32f8"/> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band></pageFooter> Link to comment Share on other sites More sharing options...
szaharia Posted September 13, 2017 Share Posted September 13, 2017 This is possible for the group named "myGroup", using evaluationTime="Now" for the current page number, and evaluationTime="Group" evaluationGroup="myGroup" for the total number of pages. Link to comment Share on other sites More sharing options...
Solution crazyzai0123 Posted September 14, 2017 Author Solution Share Posted September 14, 2017 <textField evaluationTime="Group" evaluationGroup="myGroup">I've set the evaluation Time and group but seems not working ? Did i miss something? ?? Link to comment Share on other sites More sharing options...
szaharia Posted September 14, 2017 Share Posted September 14, 2017 You also need to remove isResetPageNumber="true" from myGroup2. Mixing page numbering between groups mai cause unexpected results. Link to comment Share on other sites More sharing options...
anubha0408 Posted July 29, 2019 Share Posted July 29, 2019 Hi, is it resolved. I am having the same issue. Thanks and regardsAnubha 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