2004 IR Help Posted August 21, 2006 Share Posted August 21, 2006 By: Philippe - phgaudin How to use MyDecimalFormat ? 2005-05-23 00:14 In a Jasper Report, I would like to be able to format numbers using my own MyDecimalFormat class (which extends java.text.DecimalFormat). Is it possible ? How ? Thanks in advance ! Philippe By: Mitya - mityay RE: How to use MyDecimalFormat ? 2005-05-23 09:43 You need to pass you decimal format as a parameter to jasperreport: <parameter name="decimal_format" class="com.test.MyDecimalFormat"></parameter> And then you can use it in expression: <textFieldExpression class="java.lang.String"><![CDATA[((com.test.MyDecimalFormat)$P{decimal_format}).format(new java.lang.Double($F{value}))]]></textFieldExpression> By: Philippe - phgaudin RE: How to use MyDecimalFormat ? 2005-05-23 23:43 Thanks ! ... but that's a little bit heavy... I think I will ask an enhancement to make it a "standard configuration parameter". Philippe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now