Jump to content
Changes to the Jaspersoft community edition download ×

Jasper reports date time format? works in iReport but problematic in Jasperserver?


leejay_bell

Recommended Posts

Hello, im pretty new to jasper reports and have developed i report in Ireport 5.5.0 with two date parameters namely DateFrom and DateTo, this works fine in iReport preview but does not work in jasper reports server? I have a number of reports and what is creating a problem for me is that some reports work yet some dont? or should i say i used TO_DATE function to fix some but other reports give me the same problems by just not returning any data. I have queried the data in source and in iReport preview so i know its there.

I have also changed the date format in the jasperserver_config.properties file to this :

# Used for parsing and formatting dates by server
date.format=yy/mm/dd
datetime.format=yy/mm/dd HH:mm:ss
time.format=HH:mm:ss
calendar.date.format=yy/mm/dd
calendar.datetime.format=yy/mm/dd HH:mm:ss
calendar.time.format=HH:mm:ss

so the date picker values are appropriate and seem to be in line with what i expect.

what i have done to try and work around this is added this to my SQL query in Ireport:

bill_date = TO_DATE($P{BillingDate},'yyyy/mm/dd')

So this in my mind resolves the date format issue right? not so straight forward

I have extended the logging here to get a peak at what is acually going on and find this entry :

Parameter #1 (BillingDate of type java.util.Date): Tue Dec 31 22:03:00 CAT 2013

Although the DATE_TO oracle function should not let this be a problem what else am i missing here? I could use some advice?

 

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

ok sorry, the problem is that on the server the query that works in ireport does not return any values from jasperserver and im trying to work out where the problem is. so i run the report in ireport preview and the correct rows get returned but when i upload it to the server nothing gets returned and im trying to diagnose why that is? its seems to be date related? as it only occurs when i search for a date range and i have run out of fresh ideas.
Link to comment
Share on other sites

n term of the jasperserver_config.properties the formatting is explained as below

 

# Used for parsing and formatting dates by server

date.format=yy/MM/dd

datetime.format=yy/MM/dd HH:mm:ss

time.format=HH:mm:ss

 

# Used for parsing and formatting dates by calendar component (UI).

# Pattern for date should match appropriated pattern from server properties.

# The format for calendar component can be combinations of the following:

# d - day of month (no leading zero)

# dd - day of month (two digit)

# o - day of year (no leading zeros)

# oo - day of year (three digit)

# D - day name short

# DD - day name long

# m - month of year (no leading zero)

# mm - month of year (two digit)

# M - month name short

# MM - month name long

# y - year (two digit)

# yy - year (four digit)

calendar.date.format=yy/MM/dd

calendar.datetime.format=yy/MM/dd HH:mm:ss

calendar.time.format=HH:mm:ss

 

Changing the mm to MM will create this : 2014/March/01 the database format is this : 2014/03/01, so that doesn't work for me.

 

I don't understand while all the formats (input control's) appear to follow the 2014/03/01 format but in the log file the parameter output is : Parameter #1 (BillingDate of type java.util.Date): Tue Dec 31 22:03:00 CAT 2013 this date isn't even relevant???? I choose 2014/03/01 in the date picker!!!

 

This leads me to believe that the jasper server is submitting the parameters in the incorrect format with a strange date???

Link to comment
Share on other sites

so long and short of it is this, the parameter BillingDate is getting this date below :

 

Parameter #1 (BillingDate of type java.util.Date): Tue Dec 31 22:03:00 CAT 2013

 

when in the date picker i am selecting 2014/03/01? is perhaps the JVM date wrong? but why is the parameter value showing not what i chose? the parameter should

Link to comment
Share on other sites

  • 5 months 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...