leejay_bell Posted March 31, 2014 Share Posted March 31, 2014 Hello all, im new to Jasper and dont come from a java background and I am experiencing something strange I hope someone will be able to help me with diagnosing. I have added a date control input to a report and I have configured the jasperserver_config.properties file to use the yy/MM/dd (2014/03/01) format. the date picker display value is in the correct format that I need, I have extended the logging in the jasperserver.log file to try and capture the paramter and SQL values and I have found this line just below the SQL query : Parameter #1 (BillingDate of type java.util.Date): Tue Dec 31 22:03:00 CAT 2013.This format is incorrect and the date its wrong? I have selected the 2014/03/01 as the date? does anyone know where this date is coming from and why it isnt date pickers date? this date is not related to my hosting server or database date time so im baffled? and needless to say that my report is not returing the required data?Any help will be appreciated! thanks! Link to comment Share on other sites More sharing options...
hozawa Posted March 31, 2014 Share Posted March 31, 2014 Have you used MS Excel? Internal date format is different from presentation format. It similar with JasperReports.If you need to pass the date in certain format, pass it as a String instead of Date. Link to comment Share on other sites More sharing options...
leejay_bell Posted March 31, 2014 Author Share Posted March 31, 2014 ok. but I would like to use the date picker tool to select a date? is there a way around that problem if i use a string instead? thank you! Link to comment Share on other sites More sharing options...
mlopez_1 Posted March 31, 2014 Share Posted March 31, 2014 In jasperserver.log always has date parameters in this format.Be sure that parameter and Input Control ID are exactly equals and look for the locale settings, probably will be the problem.Regards, Mariano Link to comment Share on other sites More sharing options...
leejay_bell Posted March 31, 2014 Author Share Posted March 31, 2014 Thanks Mariano! i have created another report and I am still getting this : Parameter #1 (DateFrom of type java.util.Date): Wed Jan 01 00:03:00 CAT 2014 Parameter #2 (DateTo of type java.util.Date): Fri Jan 31 00:03:00 CAT 2014 The date value is wrong, i am selecting march not January? i have checked that my parameter and input control ID are identical. I'm not convinced that changing the locale will correct the wrong date being passed to the report? Link to comment Share on other sites More sharing options...
mlopez_1 Posted March 31, 2014 Share Posted March 31, 2014 Most of my problems about input controls and parameters in query were for names and IDs, notice that if you are using a query repository, defaults values in parameters does not take effect if no input control with the same ID is present. Always pass null to query in this case. In my jasperserver.log date's format are the same in yours and works fine. Regards, Mariano Link to comment Share on other sites More sharing options...
leejay_bell Posted April 1, 2014 Author Share Posted April 1, 2014 ok thank you,! 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