【发布时间】:2015-07-08 17:21:45
【问题描述】:
我有一个包含 2 个子报表的主报表。我正在使用自定义数据源来获取报告内容。但在 jasper studio 中预览主报表时,只显示一个子报表(以先出现的子报表为准)。
例如。仅显示 report1.jrxml。如果我删除该子报告,则显示 report2.jrxml。
main.jrxml
<detail>
<band height="250">
<subreport runToBottom="true">
<reportElement positionType="Float" x="0" y="130" width="1960" height="120" uuid="89a9f872-756e-4c82-922d-537cfde30cca"/>
<dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression>
<subreportExpression><![CDATA["report1.jrxml"]]></subreportExpression>
</subreport>
</band>
<band height="250">
<subreport runToBottom="true">
<reportElement positionType="Float" x="0" y="90" width="1960" height="120" uuid="892c0849-9532-48cb-94c0-f2e87528232a"/>
<dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression>
<subreportExpression><![CDATA["report2.jrxml"]]></subreportExpression>
</subreport>
</band>
</detail>
我已经尝试了以下方法:
- 将子报表放置在不同的详细信息带中。
- 将“位置类型”设置为“浮动”。
- 将“Run To Bottom”属性设置为“True”。
【问题讨论】:
标签: jasper-reports