0

I have a similar issue as described here but with the value type instead of value pattern. I have a value called 'Balance'

<parameter name="Balance" class="java.lang.String"/>

and corresponding field

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
    <reportElement x="400" y="55" width="117" height="7"/>
    <textElement textAlignment="Right" verticalAlignment="Top">
        <font size="7" isBold="true" pdfFontName="Helvetica" isPdfEmbedded="false"/>
    </textElement>
    <textFieldExpression><![CDATA[( $P{Balance}.equals(null) ? "" : $P{Balance} )]]></textFieldExpression>
</textField>

When I export my Jasper report as XLS, 'Balance' value comes in correct pattern (ie. $400.20) but Excel consider this as a String instead of Currency.

Any idea how to fix it would be much appreciated.

Alex K
  • 22,315
  • 19
  • 108
  • 236
marika.daboja
  • 881
  • 13
  • 27
  • So you are using a String to display a Number and wondering why Excel considers this as a String? Using Double or Float seems to be more efficient. – Markus Deindl Aug 28 '17 at 10:32
  • No, I am not surprise but when I've tried to simply change parameter to different type it was breaking my template. So still not sure what is the exact fix for it. – marika.daboja Aug 31 '17 at 03:37
  • I could help you more, if you would add the jrxml file (remove personal data before). – Markus Deindl Sep 05 '17 at 09:09

0 Answers0