Jump to content
We've recently updated our Privacy Statement, available here ×

Date Format In UpperCase


kunkasurendra

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

JasperReports uses standard Java date formatters, which as far as I can tell cannot directly produce something like "01 JUN 2008".

 

Hence you have two options:

Write your own date formatter implementation (by extending java.text.SimpleDateFormat) that produces upper case month names, and use the REPORT_FORMAT_FACTORY parameter to instruct JasperReports to use your date formatters.

Manually format the date and convert the result to upper case:

Code:

<variable name="DateFormatter" class="java.text.DateFormat" calculation="System">
<initialValueExpression>new java.text.SimpleDateFormat("dd MMM yyyy"«»)</initialValueExpression>
</variable>
...
<textFieldExpression>$V{DateFormatter}.format($F{MyDateField}).toUpperCase())</textFieldExpression>

[/ul]

 

HTH,

Lucian

Link to comment
Share on other sites

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