Hide or show Subreport

会有一股神秘感。 提交于 2019-12-07 16:52:02

问题


I have a requirement where i need to show or hide subreport based on user selection.

Say I have a Main report and two sub reports: sub1 and sub2.

User selects to show only sub1. The boolean value will be sent through Java.

I need to show main report with sub1 in it and hide sub2.

I tried <printwhenexpression> but no matter what it shows only main report.

<subreport>
    <reportElement uuid="25895ea2-ed3d-49d2-997b-f0e4e6e304a3" mode="Transparent" x="0" y="0" width="555" height="38">
        <printWhenExpression><![CDATA[($P{flag}==Boolean.TRUE)]]></printWhenExpression>
    </reportElement>
    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "subreport1.jasper"]]></subreportExpression>
</subreport>

来源:https://stackoverflow.com/questions/15557440/hide-or-show-subreport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!