kent.vickery Posted June 9, 2018 Share Posted June 9, 2018 I have a two-column subreport that has a header band, detail band, and summary band. For some reason Jasper generates a page break before the summary band even though there is lots of space left on the report for the next subreport.If I swtich to one-column OR disable printing of the summary band, then the unwanted page break goes away. I've made sure all of the content fits within the page.Help! Link to comment Share on other sites More sharing options...
sumit09 Posted June 9, 2018 Share Posted June 9, 2018 Uncheck summary on new page property and try. Thanks. Link to comment Share on other sites More sharing options...
kent.vickery Posted June 9, 2018 Author Share Posted June 9, 2018 Thanks for the feedback, but I should have said I had tried all of the obvious solutions.With further testing I found the unwanted page break before the Summary Band only happens if there is an even number of detail records being reported in the detail band. So, if there are either 9 or 10 detail records there are 4 rows written in the detail band (because it is a two column sub-report) - but the page break only shows up when both columns of there detail band are filled in (no matter how many rows are written). Link to comment Share on other sites More sharing options...
kent.vickery Posted June 9, 2018 Author Share Posted June 9, 2018 Sorry - I should have said either 7 or 8 detail records in my example above. Link to comment Share on other sites More sharing options...
shertage Posted June 11, 2018 Share Posted June 11, 2018 Please post your JRXML here, if possible, to help us reproduce the problem. Thank you. Link to comment Share on other sites More sharing options...
kent.vickery Posted June 11, 2018 Author Share Posted June 11, 2018 <?xml version="1.0" encoding="UTF-8"?><?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="mps_market_price_summary.rpt" columnCount="2" printOrder="Horizontal" pageWidth="588" pageHeight="792" whenNoDataType="AllSectionsNoDetail" columnWidth="294" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="491a4542-3fa8-4fcb-a9d7-6ac6c80b9875"> <property name="ireport.jasperserver.reportUnit" value="/JCRS/GAS2/Reports/GAS2/worksheet_details_cmps_portrait.rpt"/> <property name="ireport.jasperserver.url" value="http://10.10.30.128:8080/jasperserver/services/repository"/> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="P_APPRAISED_STUMPAGE_RATE_ID" class="java.math.BigDecimal"/> <parameter name="ORACLE_REF_CURSOR" class="java.sql.ResultSet" isForPrompting="false"/> <parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User" isForPrompting="false"/> <parameter name="p_report_id" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["mps_market_price_summary.rpt"]]></defaultValueExpression> </parameter> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[($P{REPORT_CONTEXT} != null) ? "repo:" : "H:\"]]></defaultValueExpression> </parameter> <parameter name="SUBREPORT_EXT" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[($P{REPORT_CONTEXT} != null) ? ".jrxml" : ".jasper"]]></defaultValueExpression> </parameter> <queryString language="plsql"> <![CDATA[{call GAS2_REPORTING.FIND_MPS_MARKET_PRC_SUBTOTALS(P_RESULTS => $P{ORACLE_REF_CURSOR},P_APPRAISED_STUMPAGE_RATE_ID => $P{P_APPRAISED_STUMPAGE_RATE_ID})}]]> </queryString> <field name="SUBTOTAL_DESC" class="java.lang.String"/> <field name="STUMPAGE_RTE_SUBTOTAL_TYP_CODE" class="java.lang.String"/> <field name="SUBTOTAL_VALUE" class="java.math.BigDecimal"/> <field name="APPRAISAL_METHOD_CODE" class="java.lang.String"/> <field name="MARKET_PRICE" class="java.math.BigDecimal"/> <field name="BASE_MARKET_PRICE" class="java.math.BigDecimal"/> <field name="CPIF_ADJUSTMENT" class="java.math.BigDecimal"/> <field name="TOTAL_SPEC_OPS" class="java.math.BigDecimal"/> <field name="FINAL_MARKET_PRICE" class="java.math.BigDecimal"/> <variable name="CCF0_Market Price" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{APPRAISAL_METHOD_CODE}.equals("C") ? "Estimated Winning Bid" : "Market Price (present)"]]></variableExpression> </variable> <variable name="CCF1_Final Market Price" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{APPRAISAL_METHOD_CODE}.equals("C") ? "Final Estimated Winning Bid" : "Final Market Price"]]></variableExpression> </variable> <variable name="CCF2_Section Name" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{APPRAISAL_METHOD_CODE}.equals("C") ? "Final Estimated Winning Bid Summary" : "Market Price Summary"]]></variableExpression> </variable> <title> <band height="42"> <textField> <reportElement uuid="e4c1732a-d6eb-47f9-bd55-79146965bc3d" mode="Opaque" x="0" y="2" width="586" height="14" forecolor="#000000" backcolor="#C0C0C0"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <textFieldExpression><![CDATA[" " + $V{CCF2_Section Name}]]></textFieldExpression> </textField> <staticText> <reportElement uuid="b2b1bb64-e634-4fbe-a442-57d2a7339c95" x="18" y="24" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Variable]]></text> </staticText> <staticText> <reportElement uuid="e68a8b7b-e9f0-4181-97d4-7f50b649134f" x="210" y="23" width="67" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Contribution]]></text> </staticText> <staticText> <reportElement uuid="d2786c34-95e5-4341-adc8-45d1712492c8" x="304" y="23" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Variable]]></text> </staticText> <staticText> <reportElement uuid="f6e9df90-1e49-426f-a8d4-5c22f8ef8cb5" x="504" y="23" width="67" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Contribution]]></text> </staticText> </band> </title> <detail> <band height="14" splitType="Prevent"> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="c6150097-9767-4496-85fe-f8b7d85354de" x="200" y="1" width="68" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <textFieldExpression><![CDATA[$F{SUBTOTAL_VALUE}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="47f37d6a-667f-42f2-9aa7-f6fed5204191" x="18" y="2" width="178" height="12" forecolor="#000000"/> <textElement> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <textFieldExpression><![CDATA[$F{SUBTOTAL_DESC}]]></textFieldExpression> </textField> </band> </detail> <summary> <band height="100" splitType="Prevent"> <line> <reportElement uuid="00b33963-f754-4839-8154-eac1b2c5719a" x="509" y="9" width="62" height="1"/> <graphicElement> <pen lineWidth="1.0" lineStyle="Solid"/> </graphicElement> </line> <line> <reportElement uuid="fbb76443-ba72-49d9-8047-5b59e41884d7" x="509" y="44" width="62" height="1"/> <graphicElement> <pen lineWidth="1.0" lineStyle="Solid"/> </graphicElement> </line> <line> <reportElement uuid="ad074180-1359-4959-b1c4-54a3e6eb59a8" x="509" y="78" width="62" height="1"/> <graphicElement> <pen lineWidth="1.0" lineStyle="Solid"/> </graphicElement> </line> <staticText> <reportElement uuid="caab7c22-d5f5-454c-91b0-5eb718ba8fe6" x="304" y="58" width="113" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <text><![CDATA[specified Operations]]></text> </staticText> <staticText> <reportElement uuid="df30b72d-3d30-4418-821b-0979645c3faa" x="304" y="23" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <text><![CDATA[CPIF Adjustment]]></text> </staticText> <staticText> <reportElement uuid="cdd61693-a432-42d1-8bdc-b6534a16fa5d" x="304" y="11" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <text><![CDATA[Market Price (base)]]></text> </staticText> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="e7194307-b1c5-47e1-b576-4ba552310953" x="519" y="46" width="52" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{MARKET_PRICE}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="f67ba592-c883-4d69-8d47-386b8829299f" x="304" y="80" width="181" height="12" forecolor="#000000"/> <textElement> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$V{CCF1_Final Market Price}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="1715fafa-5b6c-4350-8f88-a106c07efbee" x="304" y="46" width="128" height="12" forecolor="#000000"/> <textElement> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$V{CCF0_Market Price}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="953c81df-dc1e-49bb-b68c-c43ae1196f18" x="523" y="11" width="48" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{BASE_MARKET_PRICE}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="46c28b51-4373-42af-808c-5f8d5aa1d120" x="523" y="23" width="48" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{CPIF_ADJUSTMENT}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="2f2a9019-635a-422a-87f8-d8d738e84e73" x="523" y="58" width="48" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{TOTAL_SPEC_OPS}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="ead5d8c2-7cd5-4204-ac04-0e83ae10b279" x="519" y="80" width="52" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{FINAL_MARKET_PRICE}]]></textFieldExpression> </textField> </band> </summary></jasperReport> Link to comment Share on other sites More sharing options...
shertage Posted June 12, 2018 Share Posted June 12, 2018 Apparently there is a problem with the splitType attribute of the summary band. Try to set it as "Immediate" and see if it works as you need. If the problem is still there, please post the JRXML of the main report too. Thanks. Link to comment Share on other sites More sharing options...
kent.vickery Posted June 13, 2018 Author Share Posted June 13, 2018 Changing the splitType to "Immediate" (or any of the other options) had no effect. When an even number of detail records are being reported in the detail band, a page break gets generated before the summary band.Note the same problem happens when running this 'sub-report' as a stand-alone report, so the JRXML in the main report is not a factor.At the moment the only work-around I can think of is testing the number of details records present before calling the Jasper report and generating a null/blank detail record to ensure an odd number of details are present. 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