I have a main report with 2 subreports. I am using a custom datasource to fetch the report contents. But only one subreport gets displayed when the main report is previewed in jasper studio (whichever subreport comes first).
For eg. only report1.jrxml gets displayed.If I remove that subreport then report2.jrxml gets displayed.
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>
I have tried out the following :
- Placing the subreports in different detail bands.
- Setting "Position Type" to "Float".
- Setting "Run To Bottom" property to "True".