Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

formatting data in jasperserver

Posted on 2011-03-02
7
Medium Priority
?
1,272 Views
Last Modified: 2012-08-14
I need to create a variable called reponse time that is calculated within JasperServer / iReport.

I am currently using

datediff(S,$F{Call Started},$F{Crew Filled})/60

labeling is ResponseTime

both $F{Call Started},$F{Crew Filled} are passed via the stored procedure

error given during the compile time is S cannot be resolved

Purpose of variable - I need to take the start time and the end time to calculate the time it took from the call to the the time of filling the schedule. I can get it to work in the stored procedure but we are trying to avoid changing the st_proc.

Suggestions?

Will also be using this variable to get the average time between responses, the shortest time and the longest time.
0
Comment
Question by:tagomtech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 17

Expert Comment

by:MIKE
ID: 35023507
What is he data type for field "S".....????
0
 
LVL 35

Expert Comment

by:James0628
ID: 35025647
I haven't used JasperServer or iReport, but I'm guessing that the S is supposed to be to get the DateDiff in seconds.  Assuming that the DateDiff function is supported, I have two suggestions:

 Put the S in quotes - "S" or 'S'.  Single or double.  Whichever works.

 Maybe S is the wrong "code".  Maybe it should be s (lowercase), or seconds, or ...

 Either way (should be in quotes or it's not the right code), the error sounds like it's because something doesn't recognize the S and doesn't know how to interpret it, in which case one of those things should fix it.

 James
0
 

Author Comment

by:tagomtech
ID: 35027789
Jasper Reports uses java to calculate dates, crystal reports looks like you can create an sql query, I have created the same query in the st_proc.
ISSUE: coming up with three different results

code used in st_proc: datediff(S,clstartcalltime,a.cldatetime)/60 as [Response Time], rounds up and does not give the after decimal portion (1.48 minutes) - however this piece of code will need to be removed from the st_proc when I launch the reports. Currently I am merely trying to figure out why I am getting different results.

code used in crystal reports: (DateDiff ("s", {CC_Report_CrewHistory;1.Call Started}, {CC_Report_CrewHistory;1.Crew Filled}))/60 (This is the result that I must match using iReports - preferably without changing the st_proc.

code used in iReport (java) -$F{Crew Filled}.getMinutes()-$F{Call Started}.getMinutes() does not give me a double it returns an int - which rounds - I need to return or somehow cast this to a double - both crew filled and call started are timedate types in the database.

I am including two pics so that you can see the results of each piece of code. Any help is GREATLY appreciated.

 crystal reports - need to immulate the results shown here. crystal reports - need to immulate the results shown here. crystal reports - need to immulate the results shown here. ireport results showing both the sql and the java results
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:tagomtech
ID: 35027804
sorry for the multiple post of the first pic! happy fingers this morning
0
 
LVL 35

Accepted Solution

by:
James0628 earned 2000 total points
ID: 35035202
FWIW, for the stored procedure, you might have to specifically set the data type for the "Response Time" column to Decimal or Float.  It wouldn't surprise me if it defaulted to Int or something like that.

 For iReport, I don't know.  If that's part of a query, then maybe it's the same thing - Specifically set the data type for the column to one with decimals.  Or maybe, as you suggested, there's a Convert or Cast or similar function to set the data type.

 If you can't figure it out and no one else chimes in, you can try using the "Request Attention" link to see if you can get anyone else to help.  But, FWIW, I don't think there are many around here with Jasper / iReport experience.  I believe I've seen other questions about them go unanswered.

 James
0
 

Author Closing Comment

by:tagomtech
ID: 35057782
Have been able to calculate now just working on formatting specific to iReports
0
 
LVL 35

Expert Comment

by:James0628
ID: 35067053
OK.  I'm glad you were able to work it out.

 James
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question