我有一个主报告和两个子报告。我正在使用自定义数据源来获取报告内容。但在 jasper studio 中预览主报表时,仅显示一个子报表(以先出现的子报表为准)。
例如。仅显示report1.jrxml。如果我删除该子报表,则会显示report2.jrxml。
主.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 Code Online (Sandbox Code Playgroud)
我已经尝试过以下方法: