Jasper报告列表元素会产生额外的页面 [英] Jasper report list element produces extra page

查看:56
本文介绍了Jasper报告列表元素会产生额外的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是一些屏幕快照来演示该问题: 首先,这是没有列表元素的设计:

Here are some screen shots to demonstrate the problem: First, here is the design with no list element:

这是该报告的结果(请注意有两页):

And here is the result of that report (note that there are two pages):

现在,如果我添加列表元素,则设计如下:

Now if I add the list element, here is the design:

这是摘要区域的jrxml:

Here is the jrxml for the summary band:

<summary>
        <band height="554">
            <printWhenExpression><![CDATA[!$F{drawingRevision}.getPartsList().isEmpty() || !$F{drawingRevision}.getProcesses().isEmpty() || !$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
            <staticText>
                <reportElement positionType="Float" x="80" y="30" width="100" height="20" uuid="3210d220-35e0-4984-a00d-be4ad58feca4"/>
                <text><![CDATA[Static Text]]></text>
            </staticText>
            <rectangle radius="5">
                <reportElement x="0" y="0" width="284" height="16" backcolor="#E1E3FC" uuid="88870baf-afe8-4c0a-9b5f-fe88eb0f4dd3"/>
                <graphicElement>
                    <pen lineWidth="0.0"/>
                </graphicElement>
            </rectangle>
            <staticText>
                <reportElement x="5" y="0" width="113" height="16" uuid="9231dea5-26f2-40a8-8b45-2ce560e0f2ba"/>
                <textElement>
                    <font size="12"/>
                </textElement>
                <text><![CDATA[Design Parameters]]></text>
            </staticText>
            <componentElement>
                <reportElement x="0" y="16" width="284" height="13" uuid="12a8a577-6c77-4849-84c6-362544413192">
                    <property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Parameters"/>
                </reportElement>
                <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
                    <datasetRun subDataset="DrawingRevisionParameters" uuid="5ff517f3-e25b-4ed5-8589-33076f52c2c2">
                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getParameters())]]></dataSourceExpression>
                    </datasetRun>
                    <jr:listContents height="13" width="284">
                        <textField pattern="#,##0.####">
                            <reportElement x="0" y="0" width="50" height="12" uuid="9239498a-9b30-495f-a571-b505fceba75a"/>
                            <textElement textAlignment="Right">
                                <font size="9"/>
                            </textElement>
                            <textFieldExpression><![CDATA[$F{parameter}.getParameterValue()]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="54" y="0" width="72" height="12" uuid="f2c8d327-e8b4-4f5b-af0c-dad19c0fc4bb"/>
                            <textElement>
                                <font size="9"/>
                            </textElement>
                            <textFieldExpression><![CDATA[$F{parameter}.getParameterUnit().getUnitAbbr()]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="132" y="0" width="150" height="12" uuid="0e48fb28-af4b-4fac-8069-63bc1f880d80"/>
                            <textElement markup="rtf">
                                <font size="9"/>
                            </textElement>
                            <textFieldExpression><![CDATA[$F{parameter}.getSpecification().getSpecificationName()]]></textFieldExpression>
                        </textField>
                    </jr:listContents>
                </jr:list>
            </componentElement>
        </band>
    </summary>

最后这是该报告的结果.

And finally here is the result of that report.

请注意,浮动的静态文本"标签已适当向下移动,但不足以向报表添加额外的页面.但是,您仍然会发现报告现在有3页.

Note that the floating "Static Text" label moved down appropriately, but not nearly enough to add an extra page to the report. However, you'll see that there are now 3 pages to the report anyway.

唯一改变的是添加列表元素.我如何才能使它不添加多余的页面?还是我对清单不了解?我可能还可以将数据传递到子报表中,以便将数据显示在子报表的详细信息带中,但是如果可以的话,我更希望使用列表,因为它对我来说似乎要简单得多.我正在使用6.6.0版.谢谢!

The only thing that changed was adding the list element. How can I make it so that it doesn't add the extra page? Or what am I not understanding with regard to lists? I could probably also pass the data into a sub-report so that the data is presented in the detail band of the sub-report, but I would much prefer to use a list if I could, since it seems much simpler to me. I am using version 6.6.0. Thanks!

这是请求的完整jrxml(已删除uuid以节省字符):

Here is the full jrxml as requested (uuids removed to save on characters):

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  -->
<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="Drawing" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" whenResourceMissingType="Error">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
    <subDataset name="DrawingRevisionNotes">
        <queryString>
            <![CDATA[]]>
        </queryString>
        <field name="orderNum" class="java.lang.Integer">
            <fieldDescription><![CDATA[orderNum]]></fieldDescription>
        </field>
        <field name="drawingNote" class="com.engineering.domain.drawings.DrawingNote">
            <fieldDescription><![CDATA[drawingNote]]></fieldDescription>
        </field>
    </subDataset>
    <subDataset name="DrawingApprovals">
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <field name="revisionID" class="java.lang.String">
            <fieldDescription><![CDATA[revisionID]]></fieldDescription>
        </field>
        <field name="drafter" class="java.lang.String">
            <fieldDescription><![CDATA[drafter]]></fieldDescription>
        </field>
        <field name="approver" class="java.lang.String">
            <fieldDescription><![CDATA[approver]]></fieldDescription>
        </field>
        <field name="approvalDate" class="java.lang.String">
            <fieldDescription><![CDATA[approvalDate]]></fieldDescription>
        </field>
    </subDataset>
    <subDataset name="DrawingRevisionParameters">
        <queryString>
            <![CDATA[]]>
        </queryString>
        <field name="drawingParameterID" class="java.lang.Integer">
            <fieldDescription><![CDATA[drawingParameterID]]></fieldDescription>
        </field>
        <field name="parameter" class="com.engineering.domain.drawings.DrawingParameter">
            <fieldDescription><![CDATA[parameter]]></fieldDescription>
        </field>
        <field name="orderNum" class="java.lang.Integer">
            <fieldDescription><![CDATA[orderNum]]></fieldDescription>
        </field>
    </subDataset>
    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["static/"]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="draftCount" class="java.lang.Integer">
        <fieldDescription><![CDATA[draftCount]]></fieldDescription>
    </field>
    <field name="releaseType" class="com.engineering.domain.drawings.DrawingReleaseType">
        <fieldDescription><![CDATA[releaseType]]></fieldDescription>
    </field>
    <field name="releaser" class="com.humanresources.domain.Employee">
        <fieldDescription><![CDATA[releaser]]></fieldDescription>
    </field>
    <field name="releaseTimeStamp" class="java.time.LocalDateTime">
        <fieldDescription><![CDATA[releaseTimeStamp]]></fieldDescription>
    </field>
    <field name="company" class="com.companies.domain.Company">
        <fieldDescription><![CDATA[company]]></fieldDescription>
    </field>
    <field name="unitSystem" class="com.utilities.domain.units.UnitSystem">
        <fieldDescription><![CDATA[unitSystem]]></fieldDescription>
    </field>
    <field name="drawingReleaseID" class="java.lang.Integer">
        <fieldDescription><![CDATA[drawingReleaseID]]></fieldDescription>
    </field>
    <field name="fullDescription" class="java.lang.Boolean">
        <fieldDescription><![CDATA[fullDescription]]></fieldDescription>
    </field>
    <field name="drawingRevision" class="com.engineering.domain.drawings.DrawingRevision">
        <fieldDescription><![CDATA[drawingRevision]]></fieldDescription>
    </field>
    <background>
        <band height="554" splitType="Stretch">
            <rectangle radius="5">
                <reportElement mode="Transparent" x="0" y="0" width="752" height="553"/>
            </rectangle>
            <frame>
                <reportElement x="485" y="443" width="267" height="110">
                    <property name="ShowOutOfBoundContent" value="false"/>
                </reportElement>
                <rectangle radius="5">
                    <reportElement mode="Transparent" x="0" y="0" width="267" height="110"/>
                    <graphicElement>
                        <pen lineWidth="1.0"/>
                    </graphicElement>
                </rectangle>
                <subreport>
                    <reportElement x="0" y="0" width="180" height="34"/>
                    <subreportExpression><![CDATA[$P{SUBREPORT_DIR}+"HeaderSmall.jasper"]]></subreportExpression>
                </subreport>
                <line>
                    <reportElement x="0" y="35" width="180" height="1"/>
                    <graphicElement>
                        <pen lineWidth="0.5"/>
                    </graphicElement>
                </line>
                <staticText>
                    <reportElement x="39" y="36" width="21" height="7"/>
                    <textElement>
                        <font size="5"/>
                    </textElement>
                    <text><![CDATA[Title]]></text>
                </staticText>
                <textField>
                    <reportElement x="44" y="40" width="136" height="47"/>
                    <textElement verticalAlignment="Middle">
                        <font isBold="true"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{drawingRevision}.getTitle()]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="39" y="90" width="21" height="7"/>
                    <textElement>
                        <font size="5"/>
                    </textElement>
                    <text><![CDATA[Drawing]]></text>
                </staticText>
                <textField>
                    <reportElement x="44" y="94" width="136" height="16"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <textFieldExpression><![CDATA[String.format("%06d",$F{drawingRevision}.getDrawing().getDrawingID())+" Rev "+$F{drawingRevision}.getRevision().getRevisionID()]]></textFieldExpression>
                </textField>
                <line>
                    <reportElement x="38" y="36" width="1" height="74"/>
                    <graphicElement>
                        <pen lineWidth="0.5"/>
                    </graphicElement>
                </line>
                <line>
                    <reportElement x="180" y="0" width="1" height="110"/>
                    <graphicElement>
                        <pen lineWidth="0.5"/>
                    </graphicElement>
                </line>
                <line>
                    <reportElement x="39" y="89" width="141" height="1"/>
                    <graphicElement>
                        <pen lineWidth="0.5"/>
                    </graphicElement>
                </line>
                <frame>
                    <reportElement x="0" y="36" width="37" height="74"/>
                    <staticText>
                        <reportElement x="2" y="2" width="33" height="7"/>
                        <textElement textAlignment="Center">
                            <font size="5" isItalic="true" isUnderline="true"/>
                        </textElement>
                        <text><![CDATA[Tolerances]]></text>
                    </staticText>
                    <textField>
                        <reportElement x="2" y="9" width="33" height="20"/>
                        <textElement textAlignment="Center">
                            <font size="5" isItalic="true"/>
                        </textElement>
                        <textFieldExpression><![CDATA[$F{unitSystem}.getUnitTolerance().getUnit().getUnitNamePlural()+"\nUnless\nNoted"]]></textFieldExpression>
                    </textField>
                    <textField>
                        <reportElement x="2" y="29" width="33" height="33"/>
                        <textElement textAlignment="Center">
                            <font size="5" isItalic="true"/>
                        </textElement>
                        <textFieldExpression><![CDATA[($F{unitSystem}.getUnitTolerance().getTolerance3Place()!=null ? "X.XXX ±"+$F{unitSystem}.getUnitTolerance().getTolerance3Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getTolerance2Place()!=null ? "X.XX ±"+$F{unitSystem}.getUnitTolerance().getTolerance2Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getTolerance1Place()!=null ? "X.X ±"+$F{unitSystem}.getUnitTolerance().getTolerance1Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getFractional()!=null ? "Frac. ±"+$F{unitSystem}.getUnitTolerance().getFractional()+"\n" : "")+
"Ang. ±30'"]]></textFieldExpression>
                    </textField>
                </frame>
                <frame>
                    <reportElement x="180" y="0" width="87" height="109"/>
                    <componentElement>
                        <reportElement x="3" y="14" width="81" height="9">
                            <property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Approvals"/>
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
                        </reportElement>
                        <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
                            <datasetRun subDataset="DrawingApprovals">
                                <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getApprovals())]]></dataSourceExpression>
                            </datasetRun>
                            <jr:listContents height="9" width="81">
                                <textField>
                                    <reportElement x="0" y="0" width="17" height="9"/>
                                    <textElement textAlignment="Center">
                                        <font size="7"/>
                                    </textElement>
                                    <textFieldExpression><![CDATA[$F{revisionID}]]></textFieldExpression>
                                </textField>
                                <textField>
                                    <reportElement x="17" y="0" width="17" height="9"/>
                                    <textElement textAlignment="Center">
                                        <font size="7"/>
                                    </textElement>
                                    <textFieldExpression><![CDATA[$F{drafter}]]></textFieldExpression>
                                </textField>
                                <textField isBlankWhenNull="true">
                                    <reportElement x="34" y="0" width="17" height="9"/>
                                    <textElement textAlignment="Center">
                                        <font size="7"/>
                                    </textElement>
                                    <textFieldExpression><![CDATA[$F{approver}]]></textFieldExpression>
                                </textField>
                                <textField isBlankWhenNull="true">
                                    <reportElement x="51" y="0" width="30" height="9"/>
                                    <textElement textAlignment="Center">
                                        <font size="7"/>
                                    </textElement>
                                    <textFieldExpression><![CDATA[$F{approvalDate}]]></textFieldExpression>
                                </textField>
                            </jr:listContents>
                        </jr:list>
                    </componentElement>
                    <staticText>
                        <reportElement x="3" y="3" width="17" height="11">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
                        </reportElement>
                        <textElement>
                            <font size="8"/>
                        </textElement>
                        <text><![CDATA[REV]]></text>
                    </staticText>
                    <staticText>
                        <reportElement x="20" y="3" width="17" height="11">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
                        </reportElement>
                        <textElement textAlignment="Center">
                            <font size="8"/>
                        </textElement>
                        <text><![CDATA[BY]]></text>
                    </staticText>
                    <staticText>
                        <reportElement x="37" y="3" width="17" height="11">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
                        </reportElement>
                        <textElement textAlignment="Center">
                            <font size="8"/>
                        </textElement>
                        <text><![CDATA[APV]]></text>
                    </staticText>
                    <staticText>
                        <reportElement x="54" y="3" width="30" height="11">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
                        </reportElement>
                        <textElement textAlignment="Center">
                            <font size="8"/>
                        </textElement>
                        <text><![CDATA[DATE]]></text>
                    </staticText>
                    <textField isStretchWithOverflow="true">
                        <reportElement x="3" y="14" width="81" height="0">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
                        </reportElement>
                        <textFieldExpression><![CDATA["PRELIMINARY REVISION "+$F{drawingRevision}.getRevision().getRevisionID()]]></textFieldExpression>
                    </textField>
                    <line>
                        <reportElement positionType="Float" x="3" y="17" width="82" height="1">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
                        </reportElement>
                        <graphicElement>
                            <pen lineWidth="0.5"/>
                        </graphicElement>
                    </line>
                    <textField isStretchWithOverflow="true">
                        <reportElement positionType="Float" x="3" y="20" width="82" height="0">
                            <printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
                        </reportElement>
                        <textElement>
                            <font size="7"/>
                        </textElement>
                        <textFieldExpression><![CDATA["REV  BY  APV  DATE\n   -     "+$F{drawingRevision}.getDrafter().getInitials()]]></textFieldExpression>
                    </textField>
                </frame>
            </frame>
        </band>
    </background>
    <detail>
        <band height="554" splitType="Stretch">
            <image scaleImage="RetainShape">
                <reportElement x="5" y="5" width="742" height="548"/>
                <imageExpression><![CDATA["\\\\SERVER\\Data\\Design Files\\Drawings\\ERP Draft Images\\"+String.format("%05d",$F{drawingRevision}.getDrawing().getDrawingID())+$F{drawingRevision}.getRevision().getRevisionID()+($F{draftCount}>1 ? "p"+$F{draftCount} : "")+".jpg"]]></imageExpression>
            </image>
            <componentElement>
                <reportElement x="4" y="420" width="400" height="30">
                    <property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Notes"/>
                </reportElement>
                <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
                    <datasetRun subDataset="DrawingRevisionNotes">
                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getNotes())]]></dataSourceExpression>
                    </datasetRun>
                    <jr:listContents height="30" width="400">
                        <staticText>
                            <reportElement x="0" y="0" width="48" height="14"/>
                            <text><![CDATA[NOTES]]></text>
                        </staticText>
                        <textField>
                            <reportElement x="0" y="14" width="15" height="14"/>
                            <textFieldExpression><![CDATA[$F{orderNum}]]></textFieldExpression>
                        </textField>
                        <textField isStretchWithOverflow="true">
                            <reportElement x="16" y="14" width="384" height="14"/>
                            <textFieldExpression><![CDATA[$F{drawingNote}.getNoteText()]]></textFieldExpression>
                        </textField>
                    </jr:listContents>
                </jr:list>
            </componentElement>
            <frame>
                <reportElement x="485" y="405" width="267" height="38">
                    <printWhenExpression><![CDATA[$F{drawingRevision}.getMaterial()!=null]]></printWhenExpression>
                </reportElement>
                <rectangle radius="5">
                    <reportElement x="0" y="0" width="267" height="38"/>
                </rectangle>
                <staticText>
                    <reportElement x="4" y="0" width="100" height="13"/>
                    <text><![CDATA[Material]]></text>
                </staticText>
                <line>
                    <reportElement x="4" y="12" width="259" height="1"/>
                </line>
                <staticText>
                    <reportElement x="138" y="0" width="61" height="13"/>
                    <text><![CDATA[Coating]]></text>
                </staticText>
                <staticText>
                    <reportElement x="199" y="0" width="64" height="13"/>
                    <text><![CDATA[Notes]]></text>
                </staticText>
                <textField>
                    <reportElement x="4" y="13" width="134" height="24"/>
                    <textElement>
                        <font size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialRaw().getShortDescriptionNoCondition() + ( $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition() == null || $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription() == null || $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription().trim() == "" ? "" : ", "+$F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription() )]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="138" y="13" width="61" height="24"/>
                    <textElement>
                        <font size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialCoating()==null ? "" : $F{drawingRevision}.getMaterial().getMaterialCoating().getCoatingDescription()]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="199" y="13" width="64" height="24"/>
                    <textElement>
                        <font size="6"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialNotes()]]></textFieldExpression>
                </textField>
            </frame>
        </band>
    </detail>
    <pageFooter>
        <band height="12" splitType="Stretch">
            <textField isStretchWithOverflow="true">
                <reportElement x="0" y="0" width="418" height="12"/>
                <textElement>
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{releaseTimeStamp}+"   Release ID: "+$F{drawingReleaseID}+"     "+$F{company}.getCompanyName()]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="430" y="0" width="257" height="12"/>
                <textElement>
                    <font size="8"/>
                </textElement>
                <text><![CDATA[This proprietary drawing shall not be shared without written permission.]]></text>
            </staticText>
            <textField>
                <reportElement x="687" y="0" width="50" height="12"/>
                <textElement textAlignment="Right">
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report">
                <reportElement x="737" y="0" width="15" height="12"/>
                <textElement>
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
    <summary>
        <band height="554">
            <printWhenExpression><![CDATA[!$F{drawingRevision}.getPartsList().isEmpty() || !$F{drawingRevision}.getProcesses().isEmpty() || !$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
            <frame>
                <reportElement x="467" y="1" width="284" height="318">
                    <printWhenExpression><![CDATA[!$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
                </reportElement>
                <box>
                    <pen lineWidth="0.25"/>
                </box>
                <rectangle radius="5">
                    <reportElement x="0" y="0" width="284" height="16" backcolor="#E1E3FC"/>
                    <graphicElement>
                        <pen lineWidth="0.0"/>
                    </graphicElement>
                </rectangle>
                <staticText>
                    <reportElement x="5" y="0" width="113" height="16"/>
                    <textElement>
                        <font size="12"/>
                    </textElement>
                    <text><![CDATA[Design Parameters]]></text>
                </staticText>
                <componentElement>
                    <reportElement x="0" y="16" width="284" height="13">
                        <property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Parameters"/>
                    </reportElement>
                    <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
                        <datasetRun subDataset="DrawingRevisionParameters">
                            <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getParameters())]]></dataSourceExpression>
                        </datasetRun>
                        <jr:listContents height="13" width="284">
                            <textField pattern="#,##0.####">
                                <reportElement x="0" y="0" width="50" height="12"/>
                                <textElement textAlignment="Right">
                                    <font size="9"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{parameter}.getParameterValue()]]></textFieldExpression>
                            </textField>
                            <textField>
                                <reportElement x="54" y="0" width="72" height="12"/>
                                <textElement>
                                    <font size="9"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{parameter}.getParameterUnit().getUnitAbbr()]]></textFieldExpression>
                            </textField>
                            <textField>
                                <reportElement x="132" y="0" width="150" height="12"/>
                                <textElement markup="rtf">
                                    <font size="9"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{parameter}.getSpecification().getSpecificationName()]]></textFieldExpression>
                            </textField>
                        </jr:listContents>
                    </jr:list>
                </componentElement>
            </frame>
            <staticText>
                <reportElement positionType="Float" x="560" y="319" width="100" height="30"/>
                <text><![CDATA[Static Text]]></text>
            </staticText>
        </band>
    </summary>
</jasperReport>

推荐答案

我以前遇到过这个问题,而我所做的修复是.

I've encountered this before and the fixes I did was.

  1. 检查详细区域的大小,并确保生成的值列表都可以放入同一页面.减小细节区域的大小以查看差异.
  2. 另一个是未使用或为空的皮革带.例如,尝试通过将摘要"区域设置为当表达式时打印"为Boolean.FALSE来隐藏该区域.
  3. 您还可以转到报告属性">选中忽略分页属性"

这篇关于Jasper报告列表元素会产生额外的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆