Jump to content
Changes to the Jaspersoft community edition download ×

How to use MyDecimalFormat ?


2004 IR Help

Recommended Posts

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...