【发布时间】:2012-04-09 10:33:29
【问题描述】:
我在 Header 中创建了三个文本字段。我已将参数放入所有 textField 元素中。当我不调用三个textField 元素的三个参数之一时。它将显示 2 个textField 元素。现在的问题是文本字段之间有空格。
如何去掉空格?
这是我的代码:
<textField isBlankWhenNull="true">
<reportElement x="0" y="18" width="555" height="35" isRemoveLineWhenBlank="true"/>
<textElement textAlignment="Center">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{daterangefrom} && $P{daterangeto} ? "From ( " + $P{daterangefrom} + " - " + $P{daterangeto} + ")"
: $P{weeks} && $P{monthy} && $P{yrs} ? "For week " + $P{weeks} +" "+ $P{monthy} +" "+ $P{yrs}
: $P{monthy} && $P{yrs} ? "For monthly " +$P{monthy} +" "+ $P{yrs}
: $P{quarter} && $P{yrs} ? "For Quarter " + $P{quarter} +" "+$P{yrs}
: $P{yrs} ? "For " + $P{yrs}
: null]]>
</textFieldExpression>
</textField>
这是我的结果:
【问题讨论】:
-
您可以使用一个
textField。您使用哪种字段放置方式(垂直或水平)? -
我使用vertical.yesterday,我在一个文本字段中使用combine all,我放了双线。当三个之一不显示。它将显示 2 个文本字段。但文本字段中有空间。如何去掉空格让报表显示更有条理?
标签: jasper-reports