首页 > 代码库 > Jasper_filter data_pass field data from main to sub to filter some data
Jasper_filter data_pass field data from main to sub to filter some data
main report:
1 add variable
<variable name="Variable_rule" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{rule name}]]></variableExpression> <initialValueExpression><![CDATA[$F{rule name}]]></initialValueExpression> </variable>
2 add subreportParameter
<subreport> <reportElement x="-20" y="0" width="480" height="100" uuid="65fbc18f-3989-4701-ba4a-da8222d0a54d"> <property name="com.jaspersoft.studio.unit.x" value="pixel"/> <property name="com.jaspersoft.studio.unit.y" value="pixel"/> </reportElement> <subreportParameter name="P_ruleName"> <subreportParameterExpression><![CDATA[$V{Variable_rule}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression> <subreportExpression><![CDATA["src/table/jasper/Blank_A4_1.jasper"]]></subreportExpression> </subreport>
subreport:
1 add parameter
<parameter name="P_ruleName" class="java.lang.String"/>
2 filter data
<filterExpression><![CDATA[$V{Variable_rule}.equals($P{P_ruleName})]]></filterExpression>
Jasper_filter data_pass field data from main to sub to filter some data
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。