narayana.vr Posted April 16, 2014 Share Posted April 16, 2014 I am using iReport Designer 5.1.0,I am trying to format the date using : SimpleDateFormat("dd/MM/yyyy").format($F{DoB}) its displaying the year value wrongly.Its working good for 2000 and above years. but previous years were not displayed correctly.Can you pls help me out in sorting out this at the earliest.Thanks & Regrds Link to comment Share on other sites More sharing options...
jeeveshfuloria08 Posted April 16, 2014 Share Posted April 16, 2014 Check your field datatype in "report query" window (should be java.sql.Date). Try to use below expression, it is working for me :new SimpleDateFormat("dd/MM/yyyy").format($F{FullDateAlternateKey})/sites/default/files/images/Image.png Link to comment Share on other sites More sharing options...
mastanraosegu Posted April 16, 2014 Share Posted April 16, 2014 HI narayana.vr,I will give another idea of this problem can you write query date_format ($F{DoB},'%m/%d/%Y') .Insteded of Using Simple Date format method.Thanks & Regards,Mastanrao S Link to comment Share on other sites More sharing options...
narayana.vr Posted April 18, 2014 Author Share Posted April 18, 2014 since I'm using javabean datasource I don't have the option to write query instead I've to go with the java API methods. do you pls suggest me any other solution for this. Thanks for the reply Link to comment Share on other sites More sharing options...
narayana.vr Posted April 18, 2014 Author Share Posted April 18, 2014 I've checked the field type, since I'm using javabean datasource so the field type was set to java.util.Date.Do you have any other solution for this, as this is not getting displayed correctly. 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