[#11591] - Cannot set the user selected timezone from UI to DateRangeBuilder or RelativeDateRange

Category:
Bug report
Priority:
Normal
Status:
Confirmed
Project: Severity:
Major
Resolution:
Works as Designed
Component: Reproducibility:
N/A
Assigned to:
0

Hi,

I would like to set timezone selected by the user in UI to DateRangeBuilder or RelativeDateRange but it seems that every timezone is changed back to system default timezone

eg :

TimeZone timeZone = TimeZone.getTimeZone("Asia/Kolkata");

DateRangeBuilder dateRangeBuilder = new DateRangeBuilder("WEEK-1");
dateRangeBuilder.set(timeZone);

or

RelativeDateRange relativeDateRange = new RelativeDateRange("WEEK-1" ,timeZone,0 );

Please help and let me know how I could pass the a timezone different than system default timezone.

Thanks

v7.2
JasperReports
someUser's picture
Joined: Sep 7 2011 - 1:09pm
Last seen: 3 weeks 5 days ago

7 Comments:

#1
  • Severity:Minor» Critical
#2
  • Severity:Minor» Major
#3
  • Resolution:Open» Works as Designed
  • Status:New» Resolved
  • Assigned:nobody» chicuslavic

There is a preference:
Preferences->Jaspersoft Studio->Report Execution->Calculate date range for input parameters using report time zone.

using this one you can instruct Jaspersoft Studio to take default system locale (nothing is set) or look into what locale you've setup for your report.

It's not very clear what other behavior you propose? Eventually explain it better, how and where user should setup this Timezone? You mean setup per Input Control?

#4

I am not working with Jasper Studio, this is all in java code with the jasper imported classes.

#5
  • Status:Resolved» Confirmed
#6

"it seems that every timezone is changed back to system default timezone"

Could you post a concrete test case to reproduce the problem that you have?

Regards,
Lucian

#7

I have already added the code that is enough. I want to use client timezone but it seems that is ignored and the system timezone is always considered.
You should pass the daterange builder to a jasper report as prompted parameter , when the prompted parameter is processed in code , client timezone is added, then you send this parameter to the jrxml report.

Feedback
randomness