I have designed a report with 4 subreports, the problem is that when I print the report the 4'th report has a data that 开发者_如何学Gocan fill the whole page but it just uses half of the first page and then fills all the remaining data in the second page. how could I fill the first page?
<detail>
<band height="392" splitType="Stretch">
<subreport>
<reportElement x="0" y="0" width="555" height="100" isRemoveLineWhenBlank="true"/>
<subreportParameter name="SUBREPORT_DIR">
<subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="reciept_id">
<subreportParameterExpression><![CDATA[$P{reciept_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "alkanes_report.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement positionType="Float" x="0" y="192" width="555" height="100" isRemoveLineWhenBlank="true"/>
<subreportParameter name="SUBREPORT_DIR">
<subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="reciept_id">
<subreportParameterExpression><![CDATA[$P{reciept_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "brick_alkane.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement positionType="FixRelativeToBottom" x="1" y="292" width="554" height="100" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true"/>
<subreportParameter name="SUBREPORT_DIR">
<subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="reciept_id">
<subreportParameterExpression><![CDATA[$P{reciept_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "bases2.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement positionType="Float" x="0" y="100" width="555" height="92" isRemoveLineWhenBlank="true"/>
<subreportParameter name="SUBREPORT_DIR">
<subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="reciept_id">
<subreportParameterExpression><![CDATA[$P{reciept_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "alkanes_addittions.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
Probably what is happening is that the page size for the subreport needs to be increased.
In the main report, your subreport height is set here: height="92"
. That serves to set the minimum height of the rendered subreport. Making that larger or smaller will neither help nor hurt your issue. But if your page size is smaller in the subreport than it is in the main report, that would explain the behavior that you are describing.
精彩评论