我有一个从表中返回金额的查询:
select bus_price from mySchema.BusTable;
这将返回如下金额:
526547
123456
456789.25
12478.35
我在碧玉报告中使用了上述金额。
但是,我希望报告中的输出显示为:
$526,547.00
$123,456.00
$456,789.25
$12,478.35
JRXML 代码片段是:
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="700" y="0" width="100" height="30"/>
<textElement/>
<textFieldExpression class="java.math.BigDecimal">
<![CDATA[$F{BusPrices}]]>
</textFieldExpression>
</textField>
我知道我必须使用模式。但是,我无法使其工作。
使用
<textField isStretchWithOverflow="true" pattern='$###,##0.00'>
不管用。
我错过了什么??
谢谢阅读!