码迷,mamicode.com
首页 > Web开发 > 详细

Jasper_filter data_pass field data from main to sub to filter some data

时间:2016-12-13 19:17:01      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:div   java   nbsp   als   add   sof   lang   log   unit   

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

标签:div   java   nbsp   als   add   sof   lang   log   unit   

原文地址:http://www.cnblogs.com/liupuLearning/p/6170769.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!