kunkasurendra Posted June 11, 2008 Share Posted June 11, 2008 Hi, I am getting date as a string from DB. I haveto display it in my report in format like 01 JUN 2008but it coming like 01 Jun 2008. I don't know how to display it in above mentioned format. can any one help me out? Thanks in advance. Link to comment Share on other sites More sharing options...
lucianc Posted June 11, 2008 Share Posted June 11, 2008 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 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