Jump to content
Changes to the Jaspersoft community edition download ×

dynamic pattern for type Double


Recommended Posts



Here is my problem,

In my report, I have to display Double values with a specific pattern that comes from my xml data source. Apparently, JasperReport doesn't support dynamic pattern like this:


<textField pattern="$F{MY_PATTERN}"....


So, the solution that I found is to declare a textFieldExpression of class String and convert it like this:


[code]new DecimalFormat($F{MY_PATTERN}).format($F{MY_VALUE})


it's works nice with html export, but with excel export, the cell's format is "General" instead of "Number" of course. :(


Does somebody know how to resolve this problem?

I don't want to use "printWhenExpression" because I have got to many different patterns.


thanks in advance for your help!



Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...