2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: mike w - mwans Empty Space at Bottom of Page 2003-05-07 18:02 Hello, I have been trying to fix this problem for a long time and cannot figure it out. I have a group that calls a subreport. After printing a group, it always starts the next group on a new page. In my group definition I use the attribute, isStartNewPage="false". My subreport has a height of 480, which is more than the blank space left on the page. I want my groups to continue until the bottom of the page, not stop and leave ~400+ room at the bottom. Here is my master Report: <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="TBL_11_MASTER" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="540" pageHeight="830" columnWidth="270" columnSpacing="0" leftMargin="135" rightMargin="135" topMargin="30" bottomMargin="30" whenNoDataType="AllSectionsNoDetail" isTitleNewPage="false" isSummaryNewPage="false"> <parameter name="pYear" class="java.lang.String" /> <parameter name="pAgencyCode" class="java.lang.String" /> <parameter name="pCounty" class="java.lang.String" /> <parameter name="pWarPath" class="java.lang.String" /> <parameter name="yearExpression" class="java.lang.String"> <defaultValueExpression><![CDATA[" WHERE YEAR = " + $P{pYear} + " "]]></defaultValueExpression> </parameter> <parameter name="agencyCodeExpression" class="java.lang.String"> <defaultValueExpression><![CDATA[($P{pAgencyCode}==null || $P{pAgencyCode}.trim().equals("")?"":" AND AGENCY_CODE = '" + $P{pAgencyCode} + "' ")]]></defaultValueExpression> </parameter> <parameter name="countyExpression" class="java.lang.String"> <defaultValueExpression><![CDATA[($P{pCounty}==null || $P{pCounty}.trim().equals("")?"":" AND COUNTY_NAME = '" + $P{pCounty} + "' ")]]></defaultValueExpression> </parameter> <parameter name="theQuery" class="java.lang.String"> <defaultValueExpression><![CDATA["SELECT YEAR FROM (SELECT EXTRACT(YEAR FROM SYSDATE) - 10 + ROWNUM AS YEAR FROM SYS.ALL_OBJECTS WHERE ROWNUM < 100) WHERE YEAR BETWEEN 2003 and 2008"]]></defaultValueExpression> </parameter> <queryString>$P!{theQuery}</queryString> <field name="YEAR" class="java.lang.Integer"/> <variable name="FlagsMap" class="java.lang.Object" resetType="Report" calculation="System"> <initialValueExpression>new java.util.HashMap()</initialValueExpression> </variable> <group name="YearGroup" isStartNewPage="false"> <groupExpression>$F{YEAR}</groupExpression> <groupHeader> <band height="0"> <line> <reportElement x="0" y="0" width="0" height="0"> <printWhenExpression> ((java.util.Map)$V{FlagsMap}).put("IS_PRINT_CONTINUE", Boolean.TRUE) </printWhenExpression> </reportElement> </line> <!-- Call Subreport to Display Data --> <subreport isUsingCache="true"> <reportElement x="0" y="0" width="270" height="0" forecolor="#FFFFFF" positionType="Float"/> <subreportParameter name="FlagsMap"> <subreportParameterExpression>$V{FlagsMap}</subreportParameterExpression> </subreportParameter> <subreportParameter name="pYear"> <subreportParameterExpression>$P{pYear}</subreportParameterExpression> </subreportParameter> <subreportParameter name="pWarPath"> <subreportParameterExpression>$P{pWarPath}</subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String">".\TBL_11_ALT_GROUPS_SUB.jasper"</subreportExpression> </subreport> </band> </groupHeader> <groupFooter> <band height="0"> <line> <reportElement x="0" y="0" width="0" height="0"> <printWhenExpression> ((java.util.Map)$V{FlagsMap}).put("IS_PRINT_CONTINUE", Boolean.FALSE) </printWhenExpression> </reportElement> </line> </band> </groupFooter> </group> <title> <band height="90"> <staticText> <reportElement positionType="Float" x="0" y="0" width="270" height="16"/> <textElement textAlignment="Center"> <font size="10"/> </textElement> <text><![CDATA[Table 11]]></text> </staticText> <textField> <reportElement positionType="Float" x="0" y="15" width="270" height="25"/> <textElement textAlignment="Center"> <font size="11" isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.String">"ARRC, " + $P{pYear}</textFieldExpression> </textField> <staticText> <reportElement positionType="Float" x="0" y="30" width="270" height="20"/> <textElement textAlignment="Center"> <font size="10" isItalic="true"/> </textElement> <text><![CDATA[Year of Event by Type of Crime]]></text> </staticText> <!-- Column Header --> <rectangle> <reportElement x="0" y="50" width="175" height="40"/> <graphicElement/> </rectangle> <rectangle> <reportElement x="175" y="50" width="5" height="40"/> <graphicElement/> </rectangle> <staticText> <reportElement positionType="Float" x="0" y="50" width="180" height="20"/> <textElement textAlignment="Center"> <font/> </textElement> <text><![CDATA[Type of Crime]]></text> </staticText> <rectangle> <reportElement x="180" y="50" width="90" height="40"/> <graphicElement/> </rectangle> <rectangle> <reportElement x="180" y="50" width="90" height="25"/> <graphicElement/> </rectangle> <staticText> <reportElement positionType="Float" x="180" y="50" width="90" height="20"/> <textElement textAlignment="Center"> <font/> </textElement> <text><![CDATA[Yearly Total]]></text> </staticText> <staticText> <reportElement positionType="Float" x="183" y="75" width="87" height="15"/> <textElement textAlignment="Left"> <font/> </textElement> <text><![CDATA[ Number]]></text> </staticText> <staticText> <reportElement positionType="Float" x="180" y="75" width="87" height="15"/> <textElement textAlignment="Right"> <font/> </textElement> <text><![CDATA[Percent ]]></text> </staticText> </band> </title> <pageFooter> <band height="15"> <textField evaluationTime="Report" isStretchWithOverflow="false" isBlankWhenNull="false" hyperlinkType="None"> <reportElement x="0" y="0" width="270" height="15" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"> <printWhenExpression>((java.util.Map)$V{FlagsMap}).get("IS_PRINT_CONTINUE")</printWhenExpression> </reportElement> <textElement textAlignment="Right" verticalAlignment="Top" lineSpacing="Single" /> <textFieldExpression class="java.lang.String">new String("(continued)")</textFieldExpression> </textField> </band> </pageFooter> <summary> <band height="15"> <line direction="TopDown"> <reportElement x="0" y="0" width="270" height="0" forecolor="#000000" positionType="Float" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement stretchType="NoStretch" fill="Solid" /> </line> <staticText> <reportElement positionType="Float" x="0" y="0" width="270" height="15"/> <textElement> <font size="5" isItalic="true"/> </textElement> <text><![CDATA[Note: Percentages may not add to subtotals or to 100.0 because of rounding.]]></text> </staticText> </band> </summary> </jasperReport> ======================= here is my subreport ======================= <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="TBL_11_ROWS_SUB" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="270" pageHeight="480" columnWidth="270" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="AllSectionsNoDetail" isTitleNewPage="false" isSummaryNewPage="false"> <parameter name="FlagsMap" class="java.lang.Object" /> <parameter name="pYear" class="java.lang.String" /> <parameter name="pWarPath" class="java.lang.String" /> <parameter name="theQuery" class="java.lang.String"> <defaultValueExpression><![CDATA[" SELECT * FROM " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS YEAR_TOTAL FROM VW_TBL_11 WHERE (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) GROUP BY VW_TBL_11.ARRC_OFFENSE_ID), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS FELONY_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS HOMICIDE_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Homicide' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS ROBBERY_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Robbery' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS F_ASSAULT_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Assault' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS KIDNAP_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Kidnapping' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS F_BURGLARY_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Burglary' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS ARSON_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Arson' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS OTHER_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'F' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Other' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS MISDEMEANOR_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS M_ASSAULT_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Assault' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS DISTURB_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Disturbing the Peace' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS VANDALISM_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Vandalism' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS TRESSPASS_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Tresspassing' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS M_BURGLARY_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'Burglary' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE), " + " (SELECT SUM(COUNT(DISTINCT VW_TBL_11.ARRC_OFFENSE_ID)) AS ALL_OTHER_COUNT FROM VW_TBL_11, VW_TBL_11_CRIMES WHERE VW_TBL_11.DESCRIPTION(+) = VW_TBL_11_CRIMES.DESCRIPTION AND (VW_TBL_11.YEAR = " + $P{pYear} + " OR VW_TBL_11.YEAR IS NULL) AND (VW_TBL_11.CHARGE_TYPE = 'M' OR VW_TBL_11.CHARGE_TYPE IS NULL) AND (CRIME_TYPE = 'All Other' OR CRIME_TYPE IS NULL) GROUP BY VW_TBL_11.CHARGE_TYPE)"]]></defaultValueExpression> </parameter> <queryString>$P!{theQuery}</queryString> <field name="YEAR_TOTAL" class="java.lang.Long"/> <field name="FELONY_COUNT" class="java.lang.Long"/> <field name="HOMICIDE_COUNT" class="java.lang.Long"/> <field name= "ROBBERY_COUNT" class="java.lang.Long"/> <field name="F_ASSAULT_COUNT" class="java.lang.Long"/> <field name="KIDNAP_COUNT" class="java.lang.Long"/> <field name="F_BURGLARY_COUNT" class="java.lang.Long"/> <field name="ARSON_COUNT" class="java.lang.Long"/> <field name="OTHER_COUNT" class="java.lang.Long"/> <field name="MISDEMEANOR_COUNT" class="java.lang.Long"/> <field name="M_ASSAULT_COUNT" class="java.lang.Long"/> <field name="DISTURB_COUNT" class="java.lang.Long"/> <field name="VANDALISM_COUNT" class="java.lang.Long"/> <field name="TRESSPASS_COUNT" class="java.lang.Long"/> <field name="M_BURGLARY_COUNT" class="java.lang.Long"/> <field name="ALL_OTHER_COUNT" class="java.lang.Long"/> <title> <band height="480"> <line direction="TopDown"> <reportElement x="0" y="0" width="0" height="480" forecolor="#000000" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement stretchType="NoStretch" fill="Solid" /> </line> <line direction="TopDown"> <reportElement x="175" y="0" width="0" height="480" forecolor="#000000" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement stretchType="NoStretch" fill="Solid" /> </line> <line direction="TopDown"> <reportElement x="180" y="0" width="0" height="480" forecolor="#000000" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement stretchType="NoStretch" fill="Solid" /> </line> <line direction="TopDown"> <reportElement x="270" y="0" width="0" height="480" forecolor="#000000" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement stretchType="NoStretch" fill="Solid" /> </line> <!-- TOTAL_COUNT --> <textField> <reportElement positionType="Float" x="3" y="0" width="172" height="30"/> <textElement textAlignment="Left"> <font size="12" isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{pYear} + " Total"]]></textFieldExpression> </textField> <textField> <reportElement positionType="Float" x="183" y="0" width="42" height="30"/> <textElement textAlignment="Left"> <font size="12" isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{YEAR_TOTAL}==null?new java.lang.Long(0):new Long($F{YEAR_TOTAL}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="0" width="42" height="30"/> <textElement textAlignment="Right"> <font size="12" isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new java.lang.Float(100)]]></textFieldExpression> </textField> <!-- FELONY_COUNT --> <staticText> <reportElement positionType="Float" x="3" y="30" width="172" height="30"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <text><![CDATA[Felony]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="30" width="42" height="30"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{FELONY_COUNT}==null?new java.lang.Long(0):new Long($F{FELONY_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="30" width="42" height="30"/> <textElement textAlignment="Right"> <font isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{FELONY_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{FELONY_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- HOMICIDE_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="60" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Homicide]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="60" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{HOMICIDE_COUNT}==null?new java.lang.Long(0):new Long($F{HOMICIDE_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="60" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{HOMICIDE_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{HOMICIDE_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- ROBBERY_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="90" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Robbery]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="90" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{ROBBERY_COUNT}==null?new java.lang.Long(0):new Long($F{ROBBERY_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="90" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{ROBBERY_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{ROBBERY_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- F_ASSAULT_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="120" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Robbery]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="120" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{F_ASSAULT_COUNT}==null?new java.lang.Long(0):new Long($F{F_ASSAULT_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="120" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{F_ASSAULT_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{F_ASSAULT_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- KIDNAP_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="150" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Kidnapping]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="150" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{KIDNAP_COUNT}==null?new java.lang.Long(0):new Long($F{KIDNAP_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="150" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{KIDNAP_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{KIDNAP_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- F_BURGLARY_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="180" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[burglary]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="180" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{F_BURGLARY_COUNT}==null?new java.lang.Long(0):new Long($F{F_BURGLARY_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="180" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{F_BURGLARY_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{F_BURGLARY_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- ARSON_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="210" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Arson]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="210" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{ARSON_COUNT}==null?new java.lang.Long(0):new Long($F{ARSON_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="210" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{ARSON_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{ARSON_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- OTHER_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="240" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Other]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="240" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{OTHER_COUNT}==null?new java.lang.Long(0):new Long($F{OTHER_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="240" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{OTHER_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{OTHER_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- MISDEMEANOR_COUNT --> <staticText> <reportElement positionType="Float" x="3" y="270" width="172" height="30"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <text><![CDATA[Misdemeanor]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="270" width="42" height="30"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{MISDEMEANOR_COUNT}==null?new java.lang.Long(0):new Long($F{MISDEMEANOR_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="270" width="42" height="30"/> <textElement textAlignment="Right"> <font isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{MISDEMEANOR_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{MISDEMEANOR_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- M_ASSAULT_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="300" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Assault]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="300" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{M_ASSAULT_COUNT}==null?new java.lang.Long(0):new Long($F{M_ASSAULT_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="300" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{M_ASSAULT_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{M_ASSAULT_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- DISTURB_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="330" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Disturbing the Peace]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="330" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{DISTURB_COUNT}==null?new java.lang.Long(0):new Long($F{DISTURB_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="330" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{DISTURB_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{DISTURB_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- VANDALISM_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="360" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Vandalism]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="360" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{VANDALISM_COUNT}==null?new java.lang.Long(0):new Long($F{VANDALISM_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="360" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{VANDALISM_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{VANDALISM_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- TRESSPASS_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="390" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[Tresspassing]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="390" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{TRESSPASS_COUNT}==null?new java.lang.Long(0):new Long($F{TRESSPASS_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="390" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{TRESSPASS_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{TRESSPASS_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- M_BURGLARY_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="420" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[burglary]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="420" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{M_BURGLARY_COUNT}==null?new java.lang.Long(0):new Long($F{M_BURGLARY_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="420" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{M_BURGLARY_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{M_BURGLARY_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> <!-- ALL_OTHER_COUNT --> <staticText> <reportElement positionType="Float" x="10" y="450" width="165" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <text><![CDATA[All Other]]></text> </staticText> <textField> <reportElement positionType="Float" x="183" y="450" width="42" height="30"/> <textElement textAlignment="Left"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$F{ALL_OTHER_COUNT}==null?new java.lang.Long(0):new Long($F{ALL_OTHER_COUNT}.longValue())]]></textFieldExpression> </textField> <textField pattern="#.##"> <reportElement positionType="Float" x="225" y="450" width="42" height="30"/> <textElement textAlignment="Right"> <font pdfFontName="Helvetica"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{ALL_OTHER_COUNT}==null || $F{YEAR_TOTAL}==null || $F{YEAR_TOTAL}.longValue()==0?new java.lang.Float(0):new Float(($F{ALL_OTHER_COUNT}.floatValue()/$F{YEAR_TOTAL}.floatValue()) * 100)]]></textFieldExpression> </textField> </band> </title> </jasperReport> Thank you for all of your help! Michael By: Teodor Danciu - teodord RE: Empty Space at Bottom of Page 2003-05-11 04:36 Hi, This is a typical problem that we encounter when using large bands. As you said, after generating the first subreport on the page, which is at least 480 pixels tall (the height of the title section in the subreport, if it does not stretch) the remaining space of about 400 pixels it is not sufficient so that the engine could start an new subreport. The rule is that the engine never starts to generate a band if the remaining space on the page/column is less then the declared height of the band. Why such a constraint? Lets just say that if it where for it to start the band anyway, it could not decide if the split it will introduce in the band would suit us. It could be that the split could occur inside text field that we don't want to split or things like that. The idea is that the declared height of a band is the only instrument that enables us to declare splitting regions in the report. You problem (and is not only yours) comes from the fact that you actually declared a too large unsplitting region when you said that the title section of the subreport is 480 pixel tall. Because in fact you would want it to split if possible, so that you can get rid of the unwanted blank space on each page. The solution is very simple. Break that big <title> band into multiple little Pieces. This would be equivalent to letting the engine know about the acceptable way it could split your band. Splitting bands is already explained in this trick: http://jasperreports.sourceforge.net/tips.tricks.html#largebands In your case, I suggest you get rid of the <title> section in the subreport, and use the group header sections of some dummy groups with an empty group expression. The present content of the title section will be distributed between the extra bands introduced by those dummy groups you are going to create. <group name="DummyGroup1"> <groupHeader> ... </groupHeader> </group> Note that you don't need a group expression for your dummy groups. Such a group will break only once per report/subreport, but since your subreport seems to have only one record, it should be OK. I hope this helps. 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