samverner18 Posted February 8, 2022 Share Posted February 8, 2022 My Result-Set is as follows:poSum poDate yearweek employeeId1 2022-01-04 2022/01 P852748242 2022-01-05 2022/01 P852748243 2022-01-06 2022/01 P852748244 2022-01-07 2022/01 P852748245 2022-01-10 2022/02 P852748246 2022-01-11 2022/02 P852748247 2022-01-12 2022/02 P852748248 2022-01-13 2022/02 P852748249 2022-01-14 2022/02 P8527482410 2022-01-17 2022/03 P8527482411 2022-01-18 2022/03 P8527482412 2022-01-19 2022/03 P8527482413 2022-01-20 2022/03 P8527482414 2022-01-21 2022/03 P8527482415 2022-01-24 2022/04 P8527482416 2022-01-25 2022/04 P8527482417 2022-01-26 2022/04 P8527482418 2022-01-27 2022/04 P8527482419 2022-01-28 2022/04 P8527482420 2022-01-31 2022/05 P85274824Group0: <groupFooter>groupExpression: poEmployeeIdGroup1: groupExpression: poEmployeeIdGroup2: groupExpression: yearweekDataFields: poDate, poSumpoSum is Summarized for every group: <field name="poSum" class="java.lang.Double"> <fieldDescription><![CDATA[poSum]]></fieldDescription> </field> <variable name="sumGroup1" class="java.lang.Double" resetType="Group" resetGroup="employeeId" calculation="Sum"> <variableExpression><![CDATA[$F{poSum}]]></variableExpression> </variable> <variable name="sumGroup2" class="java.lang.Double" resetType="Group" resetGroup="kw" calculation="Sum"> <variableExpression><![CDATA[$F{poSum}]]></variableExpression> </variable>Groups are as follows: <group name="employeeId" isReprintHeaderOnEachPage="true"> <groupExpression><![CDATA[$F{employeeId}]]></groupExpression> <groupFooter> <band height="14" splitType="Prevent"> <textField textAdjust="StretchHeight" isBlankWhenNull="false"> <reportElement x="0" y="0" width="360" height="11" forecolor="#000000"/> <textFieldExpression><![CDATA["nRow1nRow2nRow3nRow4nRow5"]]></textFieldExpression> </textField> </band> </groupFooter> </group> <group name="poMitarbeiterReId1" isStartNewPage="true" isReprintHeaderOnEachPage="true"> <groupExpression><![CDATA[$F{employeeId}]]></groupExpression> <groupHeader> <band height="14"> <textField textAdjust="StretchHeight" evaluationTime="Group" evaluationGroup="poMitarbeiterReId1" pattern="###0.00" isBlankWhenNull="false"> <reportElement x="170" y="2" width="39" height="11"/> <textFieldExpression><![CDATA[$V{sumGroup1}]]></textFieldExpression> </textField>[..] </band> </groupHeader> </group> <group name="kw" isReprintHeaderOnEachPage="true"> <groupExpression><![CDATA[$F{yearweek}]]></groupExpression> <groupHeader> <band height="14"> <textField textAdjust="StretchHeight" evaluationTime="Group" evaluationGroup="kw" pattern="###0.00" isBlankWhenNull="false"> <reportElement x="170" y="2" width="39" height="11"/> <textFieldExpression><![CDATA[$V{sumGroup2}]]></textFieldExpression> </textField>[..] </band> </groupHeader> </group> All group-calculations (sum) are correct. But when tha page places the one element on the next page (page-break) the group-calculation is wrong.The gruop values for the yearweek group:Should be as follows2022/01 102022/02 352022/03 602022/04 852022/05 20But when the first produces a page-break placing only the groupFooter on the next page:2022/05 85 <- displays the value from the prevous group. Link to comment Share on other sites More sharing options...
bigalex Posted February 8, 2022 Share Posted February 8, 2022 May help if you show the entire code. Link to comment Share on other sites More sharing options...
samverner18 Posted February 9, 2022 Author Share Posted February 9, 2022 I have updated the question and uploaded the source code there.In the code I have modified the sql-query: it contains the data itself. Link to comment Share on other sites More sharing options...
bigalex Posted February 9, 2022 Share Posted February 9, 2022 Try to change the Evaluation time for that filed to "Report" Link to comment Share on other sites More sharing options...
samverner18 Posted February 10, 2022 Author Share Posted February 10, 2022 Switching Evaluation TextField from "Group" to "Report" displays the same value for every group.Group-Sums are shown like this:2022/01 202022/02 202022/03 202022/04 202022/05 20Tried other evaluation times as well - this has not solved the problem either. Link to comment Share on other sites More sharing options...
bigalex Posted February 10, 2022 Share Posted February 10, 2022 Removing the title or adjusting the group header height may correct the issue (see the attached example). Personally, I never use the title in my reports. Link to comment Share on other sites More sharing options...
samverner18 Posted February 14, 2022 Author Share Posted February 14, 2022 Thank you for the anwser.I have reworked the report and completely removed the bands title, pageHeader and pageFooter. To keep the same layout, I have used Groups to display title, and column names. The problem remains unchanged.I have simplified the report to show the problem more precise.In the "real" report:- The title band itself has variable height -> changing the height solves the problem- The number of datarows itself can solve the problem. Adding/or removing (at least) one row -> solves the problemChanging the height parameters will solve the problem in this situation. But the problem underneath remains ... only the case to revail will be different.I want to provide the report that works correct all the time 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