niennamiriel Posted August 19, 2009 Share Posted August 19, 2009 I had a question about parameter's on ireport. I had a parameter with java.util.date class. When I run the report, It shows format like 'Wed 06/10/2009'but I want format like '10/06/2009' Can I change that or is that only way to be shown?Post Edited by niennamiriel at 08/19/2009 08:28 Link to comment Share on other sites More sharing options...
baggypants Posted August 19, 2009 Share Posted August 19, 2009 Twice in a week? http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=61990 At the risk of sounding like one of those curmugeonly forum members I'd like to point out there is a search box. Link to comment Share on other sites More sharing options...
niennamiriel Posted August 19, 2009 Author Share Posted August 19, 2009 I couldn't find the helpful answer on that link Link to comment Share on other sites More sharing options...
johnwmcc Posted August 19, 2009 Share Posted August 19, 2009 There isn't an answer, yet - I had the same problem (hence the previous post to which you refer), and have reported it as a bug. A Parameter SHOULD (in my view) take on the Locale of the system on which it is installed. It doesn't, and I have not yet found a way of changing the format of a Date Parameter (it is relatively easy to format a date Variable - right click on it, and use Field Pattern - but you can't format a Parameter that way). Link to comment Share on other sites More sharing options...
m_anands Posted August 21, 2009 Share Posted August 21, 2009 i dont understand why you need that because if its date type then after taking it as input you can play around with it in query or or textfiel wherevr you using Link to comment Share on other sites More sharing options...
harinderrakkar Posted August 24, 2009 Share Posted August 24, 2009 You can use to_char function(Oracle) for date conversion to any of yours specified formats. hope this will work for U. good luck' Link to comment Share on other sites More sharing options...
Gaby38 Posted August 24, 2009 Share Posted August 24, 2009 As far as I can understand, you are asking how to change the date format of your parameters when you run a report and when you are prompted to enter these ones.I had the problem when running my reports in jasperserver : I edited the files "calendar.properties" and "jasperserver_config.properties" in $tomcat/webapps/jasperserver/WEB-INF/bundles and I got the wanted formats.When I run the report from iReport, I get also the right format.Hope this Helps Link to comment Share on other sites More sharing options...
drallpradeep Posted August 28, 2009 Share Posted August 28, 2009 " + new SimpleDateFormat("dd-MMMMM-yy").format(new SimpleDateFormat("MM/dd/yyyy").parse($P{fdate}))+ Link to comment Share on other sites More sharing options...
dgiulian Posted September 2, 2009 Share Posted September 2, 2009 I'm having the same problem, and I manage to format the date using the following code.new SimpleDateFormat("yyyy-MM-dd").format($P{pdate})The only problem is that it doesn't work whithin the SQL query :(How can I make it work in the SQL query? Link to comment Share on other sites More sharing options...
mdahlman Posted September 3, 2009 Share Posted September 3, 2009 dgiulian, You should start a new thread for this topic. In general though, you should not convert a date parameter into a string for use in your query. You end up with code like this:WHERE TO_CHAR($P{MyDate},'yyyy-mm-dd') < [some other data converted to a string] In most cases you're better off leaving dates and dates and comparing them. Or you should perform date functions on them (e.g. return the month and compare those). But casting the dates to strings and comparing them is generally bad for performance and bad for maintenance. Having said that... maybe you've got a good exception. ;-)Go ahead and add some details in a new thread. Regards,Matt Link to comment Share on other sites More sharing options...
jorgerod Posted November 29, 2016 Share Posted November 29, 2016 I'm rather asking for help. I have a problem, the date a get from input in form seems to have an invalid format for jasper query. I hardcoded '10-01-2016' for example and query was succesful. But when I use the parameter it returns empty resulta. What can I do? 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