是否有可能实现类似rowSpan与jasperrepors textfileds?如何拉伸jasperreports子报表,以适应父母身高
我有两个报告:main和subreport。
在主要细节带我有文本框和报表:
<band height="15" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="cell" stretchType="RelativeToBandHeight"
x="20" y="0" width="200" height="15"
isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="7" isBold="true"/>
<paragraph leftIndent="1" rightIndent="1" spacingBefore="1"
spacingAfter="1"/>
</textElement>
<textFieldExpression><![CDATA[$F{org_name}]]></textFieldExpression>
</textField>
<subreport>
<reportElement stretchType="RelativeToTallestObject" x="220" y="0"
width="582" height="15" isPrintWhenDetailOverflows="true">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<subreportParameter name="SUBREPORT_DIR">
<subreportParameterExpression>
<![CDATA[$P{SUBREPORT_DIR}]]>
</subreportParameterExpression>
</subreportParameter>
<dataSourceExpression><![CDATA[$F{EDU_LEVEL_DATASOURCE}]]></dataSourceExpression>
<subreportExpression>
<![CDATA[$P{SUBREPORT_DIR}
+ "/reports/scholarship_fund_analysis/sub_education_level.jasper"]]>
</subreportExpression>
</subreport>
并且在报表的细节带一个文本框。
目的是为主报表中的“org_name”textField实现类似rowSpan的操作。当子报表有很多内容时,它工作正常。
当org_name太长,子报表只有很少的行时,就会出现问题。 org_name文本字段的高度大于子报表的总高度。在主报告的下一行之前,子报表下有空余空间。
结果报告如下:
[Jasper report split type]可能的重复(http://stackoverflow.com/questions/39725089/jasper-report-split-type)&[如何增加子报表的textField高度作为主报表的textField的高度?] (http://stackoverflow.com/q/38767084/876298) –