kaptnk207 Posted August 6, 2008 Share Posted August 6, 2008 I have a simple report that lists events from our production execution system. Just noticed recently that the times shown in the report when run from JasperServer are 1 hour out from the same report run in iReport.Guess its some sort of timezone problem, but don't know where to look.The datasource is an Oracle 8i JDBC driver configured as a JNDI data source, service name=jdbc/pts, time zone=Europe/London - Greenwich Mean Time.JNDI resource configured in jasperserver/META-INF/context.xml as shown below:<Resource name="jdbc/pts" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="xxxx" password="xxxx" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@pts:1521:PTS" />The report criteria is: and date_transaction >= to_date('$P!{START_DATE} 01:00:00','dd-mm-yyyy hh24:mi:ss') and date_transaction < to_date('$P!{START_DATE} 06:00:00','dd-mm-yyyy hh24:mi:ss')From the web browser my locale is en_GB and my time zone is Europe/London - Greenwich Mean Time.If I run it from iReport a line will say 01-08-2008 01:17 BST but the same line will say 01-08-2008 00:17 BST if I run it from the browser. All other data is exactly the same.I've tried removing the time zone from the JNDI data source, but this makes no difference.Any ideas? Link to comment Share on other sites More sharing options...
lucianc Posted August 6, 2008 Share Posted August 6, 2008 Where does the START_DATE value come from? Do you have an input control for it? If so, what value are you inputting and what is the timezone listed in the JasperServer login screen?Regards,Lucian Link to comment Share on other sites More sharing options...
kaptnk207 Posted August 6, 2008 Author Share Posted August 6, 2008 $P{START_DATE) is a string input control. It would contain a value such as "01-08-2008". Time zone for the JasperServer login screen isEurope/London - Greenwich Mean Time Link to comment Share on other sites More sharing options...
lucianc Posted August 7, 2008 Share Posted August 7, 2008 Which JasperServer version are you using? If it's 2.1 or older, could you try to reset (set to empty) the data source timezone again, restart the server and see how the dates show up?Regards,Lucian Link to comment Share on other sites More sharing options...
kaptnk207 Posted August 8, 2008 Author Share Posted August 8, 2008 I'm running JasperServer 2.1 and 3.0. I'll try that suggestion and I'm also going to do a few tests against other databases (we've Oracle 7 and 8 on Win32 and HP-UX and a couple of AS/400s). Link to comment Share on other sites More sharing options...
kaptnk207 Posted August 8, 2008 Author Share Posted August 8, 2008 First test was to take away the time zone setting from the JNDI data sources as you suggested. Also restarted Tomcat and it worked perfectly. No more problems. Thanks for the advice.Now looks like JasperServer will become our standard reporting tool. Not bad for something that you can get free... 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