Jasper 报告列表元素生成额外页面

2024-05-21

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

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

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

这是摘要带的 jrxml:

<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>

最后是该报告的结果。

请注意,浮动的“静态文本”标签适当向下移动,但不足以向报表添加额外的页面。但是,无论如何,您都会看到该报告现在有 3 页。

唯一改变的是添加列表元素。我怎样才能使它不添加额外的页面?或者我对列表有什么不理解的地方?我也可以将数据传递到子报告中,以便数据显示在子报告的详细信息区域中,但如果可以的话,我更愿意使用列表,因为它对我来说似乎更简单。我使用的是6.6.0版本。谢谢!

以下是所要求的完整 jrxml(删除了 uuid 以节省字符):

<?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>

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

  1. 检查详细信息区域的大小,并确保生成的值列表都可以放入同一页面中。减小细节带的大小以查看差异。
  2. 另一个是未使用或空的隐藏带。例如,尝试通过将“打印时表达式”设置为 Boolean.FALSE 来隐藏“摘要”区域。
  3. 您还可以转到“报告属性”> 勾选“忽略分页属性”
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Jasper 报告列表元素生成额外页面 的相关文章

  • pdf生成后如何打开打印对话框?

    我编写了一些动态生成 PDF 文件的操作 类似 reports reportGenerator action 当我打电话时reports reportGenerator param dialy它将在弹出窗口中打开生成的 pdf 然后我可以按
  • 使用 Java(或不使用 Java)将 .xls 转换为 .pdf

    有没有办法转换xls文件到一个pdf 我想直接做一个动态报告pdf文件 但没有找到在 iReport 上创建动态列的方法 所以我在 Java 上创建了一个方法 导出到xls动态地 所以我想知道是否有办法将此文件转换为pdf 但它需要位于我的
  • 空“key”参数错误

    我正在使用 IReport 3 5 0 我的 java GWT 应用程序使用编译的 jasper 文件来创建报告 我正在 java 应用程序中创建数据源并使用fillReport 报告填写方法 它工作正常 它填充了我在 jrxml 和 Ja
  • 查看 Jasper 报告时出现异常“java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter”

    我正在使用 Jasper Reports 并在我的类路径中使用以下库 jasperreports 4 5 1 jar common digester3 3 2 jar common digester2 1 jar castor 1 2 ja
  • 使用 JasperReports API 生成报告时无法从 JavaBean 检索值

    我正在尝试生成一个简单的JR从列表中报告 我不断得到从 bean 检索字段值时出错 名称 此错误是由于错误的 getter 方法名称造成的 因为 jasper 使用反射从 bean 中获取字段 然而 即使在更正 getter 方法名称之后
  • net.sf.jasperreports.engine.JRException:找不到资源

    我尝试使用子报表贾斯帕软件工作室但我得到下面的例外 尽管子报表文件存在 但它找不到它 net sf jasperreports engine JRException Resource not found at D JASPERREPORTS
  • 通过 jasperreport 打印整个 HashMap

    我需要通过 jasperreport 打印整个地图 Example Column1 Column2 key1 val1 key2 val2 key2 val2 应该选择什么数据源 报告来源应包含哪些内容 PS 我不想像 P key11 那样
  • Linux 上的 Jasper 字体

    我在 Windows 上使用 verdana 制作的 jasper 报告不适用于在 red hat linux 下运行 tomcat 的客户端 有没有办法将 verdana ttf 链接到 jasper 或者解决此问题的唯一方法是在服务器端
  • Jasper 报告迭代数组列表[重复]

    这个问题在这里已经有答案了 如何创建将在 Jasper 报告中作为参数传递的详细信息部分中的数组列表进行迭代的报告 这可能吗 我搜索并找到了必须添加 ArrayList 作为数据源的解决方案 我怎么做 Regards 您可以将 ArrayL
  • 使用 iReport 将日期参数转换为 simpledate 格式

    我有一个startDate and an endDate作为输入参数 该参数在查询中使用 SELECT FROM patientRecords WHERE patientRecords dateOfdischarge BETWEEN P s
  • 如何将字段从主报表传递到表格元素?

    到目前为止 我使用列标题和详细信息带来生成表格 现在我想使用iReport 4 0 2 中的表格元素 我这样尝试过 iReport 将参数从主报表查询传递到表或列表的数据集查询 https stackoverflow com questio
  • 如何修复 Jaspersoft studio 插件中由 TraceGovernor 引起的 java.lang.NullPointerException?

    我正在为 Jaspersoft studio 编写最新的插件 当尝试打开报告预览时 插件崩溃 来自插件 java lang NullPointerException 的堆栈跟踪 com jaspersoft studio debug Tra
  • 如何在Ireport中给出多选参数空值的条件?

    我正在使用以下方法编写报告iReport http en wikipedia org wiki JasperReports Third party tools我想在其中添加空值条件 它使用单选选项 city P p city or P p
  • JasperReports 中的变量、参数和字段有什么区别?

    我是新手贾斯珀报告 一直在研究一些小样本 看来 字段 参数 和 变量 非常常用于演示动态数据 而且看起来很相似 那我能问一下他们具体有什么区别吗贾斯珀报告 我猜变量是 Jasper 报告中定义的东西 可以动态改变 参数是从外部源 Java
  • net.sf.jasperreports.engine.JRException:从 bean 检索字段值时出错:First_name

    我想使用 Jasper Reports 创建 CSV 有很多相关的问题 但没有任何对我有用 下面是我的 Bean 类 public class DataBean public String First name public String
  • 未找到 GroovyEvaluator

    我会尝试在以下位置制作我的 PIE 3D 报告iReport 在我的 struts xml 中 我用这个来调用我的报告
  • jasperreports-javaflow有什么用?

    jasperreports javaflow有什么用 我参考了下面两个链接 不清楚 你能详细说明一下吗 http community jaspersoft com questions 541789 jasperreports versus
  • 将 JasperServer“嵌入”外部 Web 应用程序?

    有什么方法可以将 JasperServer 集成 嵌入到另一个 Web 应用程序中吗 问题是 JasperServer 的登录页面应该以某种方式绕过 是否可以通过 Web 服务 REST 进行身份验证 跳过登录页面 然后显示主服务器页面if
  • Jasper 报告 - 详细信息不会打印在首页上

    我有一个报告 其中设置了标题带和包含表格的详细信息带 这两个带之间没有间距 当我查看 打印报告时 详细信息区域开始在第 2 页的顶部打印 第 1 页的页眉和页脚之间留有较大的空白区域 如何让详细信息区域直接打印在第 1 页的标题下方 编辑
  • 趋势线的最佳拟合曲线

    问题约束 数据集的大小是已知的 但数据本身并不已知 数据集每次增长一个数据点 趋势线一次绘制一个数据点 使用样条 贝塞尔曲线 Graphs 下面的拼贴画显示了具有相当准确的趋势线的数据集 这些图表是 左上 按小时计算 大约有 24 个数据点

随机推荐