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

Schedule does not consider timezone


marcosmalfatti

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

What JS version are you using?

 

What exactly do you mean by the timezone being ignored when scheduling a report? Is it about the date/time values in the report? Also, which selected timezone are we talking about: the one from the login screen or the one from the report job schedule screen?

 

Regards,

Lucian

Link to comment
Share on other sites

Hi Lucian

 

I using iReport 1.3.1 and JasperServer 1.2

The step-to-step of I proceed is:

In the list of reports on Repository I click in the icon Schedule Report of report what I want scheduling.

Then I click in the button Schedule Job

I supply the Label and Description of Job and click Next

I select timezone(GMT-3) the date, time and recurrence of the job and click Next

Finally, I supply the Base Output File Name, select the Output Formats, Locales, Folder and Sequential File Names. And supply the Mail Address, Subject and Message Text. Select Attach Files and save.

When the job run, the values os java.util.Date() fields is displayed in GMT values, independently of which I choose in job.

I testing with diferents timezone, because I create GMT-3 timezone, but the results is the same, java.util.Date() is always GMT.

If instead of I scheduling the report, I execute then, the values is correctly.

Thank for all

Link to comment
Share on other sites

The timezone selected in the job schedule screen is currently only used to interpret the job schedule dates, and not for the date values in the report output; the dates are always formatted using the default server timezone, as you've noticed.

 

Please log this issue as a bug here. We will analyze it and decide on a resolution.

 

In the meantime, you can change the current behaviour by extending ReportExecutionJob:

Code:

public class TZSensitiveReportExecutionJob extends ReportExecutionJob {
protected void updateExecutionContextDetails() {
super.updateExecutionContextDetails();

String tzId = getJobDetails().getTrigger().getTimezone();
TimeZone tz = TimeZone.getTimeZone(tzId);
((ExecutionContextImpl) executionContext).setTimeZone(tz);
}
}

 

I'm attaching a jar containing the compiled class for your convenience.

 

To use the extended class, you would need to edit WEB-INF/applicationContext-report-scheduling.xml, find the "reportQuartzScheduler" and set the extended class as job class:

Code:
[code]
<bean id="reportQuartzScheduler" class="com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportJobsQuartzScheduler">
...
<property name="reportExecutionJobClass">
<value>com.jaspersoft.jasperserver.api.engine.scheduling.quartz.TZSensitiveReportExecutionJob</value>
</property>
</bean>

 

Regards,

Lucian [file name=js_schedule_tz_1.jar size=2176]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/js_schedule_tz_1.jar[/file]

Link to comment
Share on other sites

  • 8 years 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...