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

How to get an Input parameter in UK date format?


johnwmcc

Recommended Posts

I have a simple and I'm sure a common requirement, but can't see how to implement it.

I have a report where I want to prompt for a parameter for the Start date for items to include.

I have successfully set up such a Parameter, type java.util.date, and also successfully modified the report query to use it to limit the report to items after that date.

Unfortunately, the parameter I input is always interpreted as if it were a US date (mm/dd/yyyy) - so if I input 1/9/2007 I get results from 9 Jan 2007, NOT 1 September 2007.

I and my users will need UK dates.

I have searched the forum for permutations of Date, Parameter, UK, Format, and Input, and found very few even nearly relevant posts.

There were a couple that came close to my question, but I didn't understand the complex answers, and I can't (yet, anyway) believe that the answer has to be that complex!

I'm very new both to Java and to iReport - I've only used iReport  for three days, and Java for even less than that.

I have done a lot of programming over many years, but not in Java, only in PHP, Javascript, and Microsoft VBA for Access and Excel and years ago in Fortran.

My Windows Vista machine is set to UK locale.

I've looked in all the iReport Tools/Options for a date format option, and can't see one.

I have changed the format of a Date FIELD with the appropriate Pattern, but there isn't such an option for a Date PARAMETER.

This must be a common requirement in the UK, but I can't find how to solve it!

Help would be much welcomed - I've spent nearly two hours hunting this forum, and the wider internet, without success.

Thanks if you can help

John McC

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

In some ways, it's even worse than I had thought. If I put in the date of 14/08/2007 (UK dd/mm/yyy date of 14 August 2007) instead of rejecting it as an invalid (US mm/dd/yyyy) date, it returns values from 08 Feb 2008 - month 14 in year 2007, anyone? Logical, in a weird way, but not actually helpful.

I'll try to put this in as a bug report, but I'm not yet sure how to.

John McC

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