I have a query which returns amount from a table:
select bus_price from mySchema.BusTable;
This will return amounts like:
526547
123456
456789.25
12478.35
I am using above amounts in jasper report.
However, I want the output in the report to be displayed as:
$526,547.00
$123,456.00
$456,789.25
$12,478.35
JRXML code snippet is:
<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>
I know I have to use patterns. However, I am not able to make it work.
Using
<textField isStretchWithOverflow="true" pattern='$###,##0.00'>
is not working.
What am I missing ??
Thanks for reading!