Jump to content
Changes to the Jaspersoft community edition download ×

quantzie

Members
  • Posts

    5
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by quantzie

  1. Hi everyone! I am having some problems with some time output. I've created 2 parameters in iReports: FROM_TIME TO_TIME and these are in java.sql.timestamp. These 2 are my time inputs. These 2 parameters are then transferred to another 2 parameters called TIME1 TIME2 where the expressions for them are new java.text.SimpleDateFormat(" kk:mm:ss").format($P{FROM_TIME}) and new java.text.SimpleDateFormat(" kk:mm:ss").format($P{TO_TIME}). This is to change them to a time format in hours, minutes and seconds. I need this step because it is passed back into my SQL query and r."rec-time" >= date_part('hour',(('2000-01-01' ||$P{TIME1})::timestamp)) * 3600 + date_part('minute',(('2000-01-01' ||$P{TIME1})::timestamp)) * 60 + date_part('second',(('2000-01-01' || $P{TIME1})::timestamp)) and r."rec-time" <= date_part('hour',(('2000-01-01' ||$P{TIME2})::timestamp)) * 3600 + date_part('minute',(('2000-01-01' || $P{TIME2})::timestamp)) * 60 + date_part('second',(('2000-01-01' || $P{TIME2})::timestamp)) Since my data is calculated in seconds, this is the only method that I can think of. Whenever I use preview, everything works perfectly. But when I upload my report onto the Jasper repository and run iReport, a Date/time input of FROM_TIME and TO_TIME using 9:00:00 and 17:00:00 becomes 9:09:09 and 17:17:17. The funny thing is that when I run the report in localhost:8080/jasperserver it actually works!
  2. Hi everyone! I am having some problems with some time output. I've created 2 parameters: FROM_TIME TO_TIME and these are in java.sql.timestamp. These 2 are my time inputs. These 2 parameters are then transferred to another 2 parameters called TIME1 TIME2 where the expressions for them are new java.text.SimpleDateFormat(" kk:mm:ss").format($P{FROM_TIME}) and new java.text.SimpleDateFormat(" kk:mm:ss").format($P{TO_TIME}). This is to change them to a time format in hours, minutes and seconds. I need this step because it is passed back into my SQL query and r."rec-time" >= date_part('hour',(('2000-01-01' ||$P{TIME1})::timestamp)) * 3600 + date_part('minute',(('2000-01-01' ||$P{TIME1})::timestamp)) * 60 + date_part('second',(('2000-01-01' || $P{TIME1})::timestamp)) and r."rec-time" <= date_part('hour',(('2000-01-01' ||$P{TIME2})::timestamp)) * 3600 + date_part('minute',(('2000-01-01' || $P{TIME2})::timestamp)) * 60 + date_part('second',(('2000-01-01' || $P{TIME2})::timestamp)) Since my data is calculated in seconds, this is the only method that I can think of. Whenever I use preview, everything works perfectly. But when I upload my report onto the Jasper repository and run the report, a Date/time input of FROM_TIME and TO_TIME using 9:00:00 and 17:00:00 becomes 9:09:09 and 17:17:17. Does anyone know why it is running fine in iReports but once it is being used in the repository, it bugs up the time input?
  3. If the default formats are not to your liking maybe you could make your own custom format? You can see the pattern codes when you click on things like currency, dates, etc. Then edit them to suit your needs
  4. Thanks for the reply! I've been trying to find a way to calculate the dates in that direction but I couldn't think of a way to do it. Also, I think you are talking about the evaluation time? I've read up on it. Thanks!
  5. Hi everyone! I'm a beginner at coding and I've been trying out iReports. I would like to get an output of a date that will be 1 year before today each time I run the reports. I'm using PostgreSQL with iReport 3.7.4. I've the latest java version and I still can't find the class java.util.calendar inside iReports. The only ones that I can see are java.util.dates and java.sql.timestamp. How do I import in the java.util.calendar because I have searched around the internet and I can find examples of people using it. Thanks!
×
×
  • Create New...