Jump to content

how to convert string date to date format in jasper report


Recommended Posts

Hi Friend I've use Jasper Ireport 5.2.0, i want to generate student mark sheet with student date of birth.

Data type of a date of birth in Table is varchar, so I've convert string date to original date format but result is wrong.

For example date of birth is 08-08-1994(dd-MM-yyyy) but i got after convertion like this 08-04-1996(dd-MM-yyyy). my convertion code is,

new java.text.SimpleDateFormat("dd-MM-yyyy").format(new java.text.SimpleDateFormat("dd-MM-yyyy").parse($F{birthDate})).

where i got mistake, any one can help me asap..... my process is pending.

Thanks to advance

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...
  • 6 months later...

I have a Similar Problem. For a jasper report, I am passing the Report Date as Parameter String in dd/MM/yyyy format. But I would like to convert this string to MMM dd, yyyy format during the runtime. The (new SimpleDateformat ("MMM dd, yyyy).format($P{REPORT_DATE}) is not working, I get runtime error. Please help



Link to comment
Share on other sites

  • 8 months later...
  • 5 years later...

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