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

date appears one day prior to what is programmed


fcramy

Recommended Posts

 My biggest single gripe about JasperServer is that it flat out behaves differently than JasperReport (specifically, jasperreports developed in iReport).

 

The problem I'm seeing now is that dates are displayed as one day prior (in fact, exactly 4 hours prior) to the date put into the parameter.

this is what I put into the default value expression of the JRXML:

 

 

 ((new Date().getMonth() / 3) + 1 == 1)? new Date(new Date().getYear(), 0, 1) :

((new Date().getMonth() / 3) + 1 == 2)? new Date(new Date().getYear(), 3, 1) :

((new Date().getMonth() / 3) + 1 == 3)? new Date(new Date().getYear(), 6, 1) :

new Date(new Date().getYear(), 9, 1) 

 

 

This code works to correctly calculate the beginning of the quarter from within the default value expression of JasperReports. When i run this through iReport, i see no problem whatsoever. For any reports I've run in this quarter, i'm seeing July 1, 2010 as the start date.

When I modify the JRXML to account for the "repo:subreport_name" format of jasperserver and run this report and have jasperserver email the output to me I get a different result:

 

 

6/30/10 8:00 PM

 

This seems like a bug to me.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

 so i've found this:

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=47753

 

which points to this:

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=45272

 

which effectively says this:

Resolved the problem by blanking the time zone setting for the data sources used in JasperServer. Apparently if this is left blank on the data source config, it will use the local time zone (since I am 7-8 hours from GMT, the time difference calc's were resulting in dates being one-day off).

 

how do I go about "blanking the time zone setting for the data sources used in JasperServer."? 

Link to comment
Share on other sites

fc_rba
Wrote:

how do I go about "blanking the time zone setting for the data sources used in JasperServer."? 

Locate the JNDI or JDBC data source object in the JasperServer repository (you can edit the report unit and see the data source path in the Data Source section).  You'll see a Time Zone select; make sure nothing is selected there (in 3.7 the default option is labeled Use database setting).

Regards,

Lucian

Link to comment
Share on other sites

  • 2 years later...

Hi All,

I faced the same issue. My date is coming one less from database. I have set it then as mentioned below:

You can set the database timezone in jasper server from where you are setting the datasource for your iReport. So, go to jasper server, add/edit datasource, set TimeZone to the one you want. If you want the date to coming from database, set 'Use Database Settings' from dropdown. Please do let me know if you face any issue in this.

Thanks,
Saurabh

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