Jump to content
Changes to the Jaspersoft community edition download ×

rajuchacha007

Members
  • Posts

    67
  • Joined

  • Last visited

rajuchacha007's Achievements

Enthusiast

Enthusiast (6/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. I noticed this. I kept on searching to find a way to resolve (I thought i am doing something wrong in sql syntax). I should have pointed out it earlier though. I was working on some other issues as well. Got your point. Sorry for this long post. It's been to long. Thank you very much for the help.
  2. issue resolved. moved $P{SUBREPORT_DIR} from the default expression and it worked.
  3. Slow, This is what I have achieved so far. Database: I am selecting 2 dates from database. starttime and endtime. Variables: I have defined following variables. name class expression startdate java.util.date $F{starttime} endDate java.util.date $F{endime} starttimems java.lang.long new Long((new DateTime($V{startDate})).millisOfSecond().getMillis()) endtimems java.lang.long new Long((new DateTime($V{endDate})).millisOfSecond().getMillis()) joda_period java.lang.Object I took a textfield(java.util.String) and pasted following expression Now taking a textfield and putting expression ($V{endtimems}-$V{starttimems}) i am getting milliseconds. I am attaching the report. Apart from those I tried, ($V{endtimems}-$V{starttimems}).getHours()+"hh "+($V{endtimems}-$V{starttimems}).getMinutes()+"mm "+($V{endtimems}-$V{starttimems}).getSeconds()+"ss "+($V{endtimems}-$V{starttimems}).getMillis()+"ms " I also tried, " "+(new Period($V{starttimems}.getTime(),$V{endtimems}.getTime())).getHours()+"hh"+ " "+(new Period($V{starttimems}.getTime(),$V{endtimems}.getTime())).getMinutes()+"mm"+ " "+(new Period($V{starttimems}.getTime(),$V{endtimems}.getTime())).getSeconds()+"ss"+ " "+(new Period($V{starttimems}.getTime(),$V{endtimems}.getTime())).getMillis()+"ms" I also tried $V{joda_period}.getHours()+"hh "+$V{joda_period}+"mm "+$V{joda_period}+"ss "+$V{joda_period}+"ms ". Now I tried (new SimpleDateFormat("HH 'hh', mm 'mm,' ss 'ss',SS 'ms'")).format(new Date(($V{endtimems}-$V{starttimems}).longValue()-3600000)) without using joda. I am getting following result. I am attaching 2 pdf files here. Also, how to view milliseconds in mysql. I have been trying to get milliseconds column but not successful yet. Not sure how you did print start_time: 23/08/2010 10:57:00:592. Please suggest. I know you have used oracle DB. I am afraid that i am going at wrong direction as i am using mysql. While searcing I found that MySQL doesn't support milliseconds in any of the time / date columns, or return it in NOW(). Thank you for your help. Best regards. Post Edited by rajuchacha007 at 08/31/2010 09:32
  4. hello. thanks for the reply. I did everything as per steps. I have defined 2 variables for startDate and endDate of the type java.util.Date(). For startDate in the variable expression i am writing $F{starttime} instead of new date() as $F{starttime} is my actual start time from the database.$F{starttime} is of type java.sql.timestamp() though. I have same thing for endDate(java.util.Date)variable expression $F{endtime}(from database of type java.sql.timestamp. Is this the thing where in i am going wrong? I mean while defining variable expression? Also I got here a variable called $V{jodaPeriod}(of type long) and tried both expression with the change as per my names. Instead of now and start_time I am using my corresponding variables. I went through these articles as well. I tried it by changing its expression class (from java.util.Date to java.sql.TimeStamp and vice versa). It is really easy to use but i am bungling some where. Thank you. Best regards.
  5. rajuchacha007 Wrote: Time_diff uses the joda Period to create a time difference and print only the details you prefer (hours, minutes, seconds, milliseconds...) I used JodaTime as you asked, but I think the report can be done without it, simply using java Date, long etc. teps partially now. thanks :) will you please guide how does it show in the format like 0hh 0mm 0ss 15ms. Right now i am getting milliseconds difference. Not able to convert them in 0hh 0mm 0ss 15ms in this format. Thank you in advance. I have imported joda class. BEst regards Post Edited by rajuchacha007 at 08/27/2010 12:17
  6. issue resolved. moved $P{SUBREPORT_DIR} from the default expression and it worked.
  7. @CharleyDC5 Hello, I am having the same problem. Would you please let me know how did you find the solution? Thank you in advance.
  8. Experts, I am using master-subreport functionality for the report. Later I am execute both through java code. Until now, I thought there is no issue. Problem occured when I tested my code on other macine. It didn't generated the report and displayed an error message that it could not find the subreport's expression. When I checked it, I found that SUBREPORT_DIR's default value expression was set to D:\\databaseReports\\. It was set when I used to test the report on my machine. Now problem is even though I set this default value expression to default, it doesn't display the reports. How could I change this expression to relative path other than this hard coded path"D:\\databaseReports"? I am not able to execute those reports when I remove this expression. Please suggest the ideas/advices. Thank you in advance. Best regards.
  9. I got your point. Thank you for the explanation. Just wanted to know, how did you bring start_time (ms)in the report? Did you define a new variable here? I can see the difference between start_time (ms) and now(ms) there. I think I should subtract my report's dates in this way so that I can get every element including milliseconds. i am experimenting for my result set so that there should be less coding in the actual java programming while executing the report. Thanks for the time to time suggestions.
  10. "Hello, i understand how to fill the JasperReport with data when i put the sql into the iReport. But how can i fill the JasperReport with Data from Java code? Can somebody please give me an example greets" You need to pass key:value pair via a hashmap: HashMap hm = new HashMap(); hm.put("Key", "Value"); illustrated below in a a sample code which might not work on your machine. Best regards Code: Post Edited by rajuchacha007 at 08/20/2010 12:20
  11. First of all thank you for the present. :D :). It certainly works for the milliseconds. I am looking for difference between two dates including difference in milliseconds. Following is my output at the moment. ID StepName StartTime EndTime RunTime Status 3 Process1 2010-08-09 02:08:00 AM 2010-08-09 02:08:01 AM 00:00:01 Success 4 Process2 2010-08-09 02:08:01 AM 2010-08-09 02:15:00 AM 00:06:59 Success My concern is to display milliseconds difference if any. That is why I tried to use Timedff(above query) etc. It didn't work. I read about joda time and asked about it if it is feasible. I tried to use your solution. I think it is not working. I really appreciate your help/solution. I think i should try while executing the report in java code. What do you recon? I mean there must be some mechanism to import these fields in java code with modifications? Am I thinking rather guessing correct? Thank you very much. Best regards.
  12. Hello, Following is quiet old link to understand Step by Step Instructions on How to Run a Jasper Report from Java. Go through it. It might help you in solving your problem. http://www.cise.ufl.edu/~otopsaka/CIS4301/ReportDemo/ReportFromJava.html Best regards.
  13. David has already explained you the correct thing. For your knowledge, visit the following topic. It might help you. (Courtesy slow) http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=74078&topid=74163#74163 Best regards.
×
×
  • Create New...