【发布时间】:2017-06-23 21:49:21
【问题描述】:
我想在我的帖子中设置样式,但它不起作用,我有一个错误:
1. Parameter not found : choixImpression
但问题是我创建了变量,如果我将它添加到文本字段中,它将显示但条件样式不起作用。
我的jrxml:
<jasperReport ...>
<style name="Table 1_TH" mode="Opaque" backcolor="#2E6F98">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{choixImpression}.toString().equals("MODERNE_NOIR_ET_BLANC"))]]></conditionExpression>
<style backcolor="#99FF99"/>
</conditionalStyle>
</style>
<parameter name="choixImpression" class="java.lang.String"/>
<variable name="choixImpression" class="java.lang.String">
<variableExpression><![CDATA[$P{choixImpression}]]></variableExpression>
</variable>
<title>
<band height="198" splitType="Stretch">
<textField>
<reportElement style="Table 1_TH" mode="Opaque" x="201" y="63" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{field}]]></textFieldExpression>
</textField>
</band>
</title>
</jasperReport>
【问题讨论】:
-
尝试在报告的标题处添加
<property name="net.sf.jasperreports.style.evaluation.time.enabled" value="true"/>。问题描述here -
-
顺便说一句,在变量表达式中使用参数的原因是什么?
-
我仍然有错误,它没有改变任何东西
标签: jasper-reports