zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    20201016---不做清单
    20201014--增删改查
    20201013--什么是真实的自己?
    多态
    继承
    关键字
    分类思想
    常用的linux命令
    九九乘法表
    稀疏数组
  • 原文地址:https://www.cnblogs.com/liupuLearning/p/6170769.html
Copyright © 2011-2022 走看看