Jump to content
We've recently updated our Privacy Statement, available here ×

DarkRaven

Members
  • Posts

    14
  • Joined

  • Last visited

DarkRaven's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Hi ! What you discribe is a totaly different problem and I think you should open a new topic for this question. In my case MySQL has a timestamp format like 1772332112 or something else. If you save this in your DB as a string, you'll get problems while converting this timestamp in Java. But If you change your DB field type to "timestamp", Java is able to calculate with it. That's the solution in my case. Hope you'll get help soon ! ;) CU Christian
  2. Hi ! JasperReports and iReports are great tools for building Java based reports, but is it possible to integrate this reports in a HTML or PHP document ? I ask, because it is Java and not JavaScript so it would not work. Is there a way to integrate it in a Website or do you know other Report builders wich are able to use in this way ? Greets Christian Beermann
  3. [color=#FF0000]SOLVED !!![/color] Damned ! That's it ! You have to change the databasefield to type:timestamp. But be careful ! This change deletes all values in the timestamp fields at first ! So it's good to have a test server ! :whistle: Thanks to all helping hands ! ;)
  4. Hi ! Ok, I tried so, but this has the same effect. I found some information about the timestamp format which is used in java.sql.timestamp. You have to change the MySQL table field value to timestamp. Then it looks like 05-04-2007 12:15:04.3 and only then you can use it with iReport and SimpleDateFormat or with the pattern. I'll try this... :woohoo:
  5. Ok, I think I've found the problem, but did not know how to cast. After adding a secound TextField in the report with the code: $F{logs_timestamp}.toString() I'm able to see the roughly data from the timestamp. It sais: 2019-1-03 23:06:00.0 So this seems to be a wrong type cast. Did you know how I can cast the timestamp from string to java.sql.timestamp ? :huh:
  6. Hi ! I've a problem with the integration of MySQL timestamps in the iReports. A normal MySQL timestamp looks like this 1195642306 (translation: 21.11.2007 - 11:51:46 (german format)). I selected the databasefield in iReport as java.sql.timestamp and used the following code in a TextField of iReport: new SimpleDateFormat("dd.MM.yyyy - HH:mm:ss").format($F{logs_timestamp}) But the values didn't match. For the example timestamp (above) the result is 03.01.2019 - 23:06:00. What is wrong ? I've no idea ! :blink: Greets Christian
  7. PROBLEM SOLVED !!! The last hint was the right one. Thank you ! :laugh: You have to enter: new SimpleDateFormat("dd.MM.yyyy - HH:mm : ss")) .format($F{logs_timestamp} Then you have to change the database field type (in iReports) to java.sql.timestamp and then it works. Before the type was set to string as default. Thank you to all people who helped me ! :woohoo:
  8. Ok, this seems to be a problem now. The MySQL timestamps is a string variable like this: 1182757393 is it possible to use PHP in iReport to cast the values or is there a Java method to do this for me ? I ask, because I think the SimpleDateFormat is only able to use for "normal" date values like 11-30-2007 15-16 or something else. Damn, it seems that I have to learn Java ! :laugh:
  9. ErrorÂevaluatingÂexpressionÂ: ÂÂÂÂSourceÂtextÂ:ÂnewÂSimpleDateFormat("dd.MM.yyyyÂ-ÂHH:mmÂ:Âss")).format($F{logs_timestamp} java.lang.IllegalArgumentException:ÂCannotÂformatÂgivenÂObjectÂasÂaÂDate ÂÂÂÂatÂjava.text.DateFormat.format(UnknownÂSource) ÂÂÂÂatÂjava.text.Format.format(UnknownÂSource)Â:pinch:
  10. Here is the format I need the timestamp in: new SimpleDateFormat("dd.MM.yyyy - HH:mm : ss").parse($F{logs_timestamp}) (I've to enter two spaces here in the forum near "mm_:_ss", because instead I'll get the :S smily ! ) Post edited by: DarkRaven, at: 2007/11/20 13:55
  11. Hi ! Ok, but now I get the first error again: Cannot cast from Date to String. :S
  12. Oh, I've forgotten to set up the textfield preferences... If I switch it to java.util.Date there is an error, too: Cannot cast from String to Date. Is it possible to cast in the iReport software ? Post edited by: DarkRaven, at: 2007/11/20 12:37
  13. Thank you for the fast reply ! I tried your example: 1. place a text field in my report 2. entering the data in the "edit expression" dialog (right mouse button) 3. inserting: new SimpleDateFormat("dd MMMM yyyy").format($F{logs_timestamp}) But I get an error: Error evaluating expression: Source text : new SimpleDateFormat("dd.MM.yyyy").format($F{logs_timestamp}) java.lang.IllegalArgumentException: Cannot format given Object as a Date What is wrong here ? Post edited by: DarkRaven, at: 2007/11/20 12:27 Post edited by: DarkRaven, at: 2007/11/20 12:28
  14. Hi out there ! Do you know how to convert a mysql timestamp to a normal date/time (e.g.: 13.11.2007-13:45) value ? I've a mysql table in which I saved timestamp values in a VarChar(15) field. Today I know that there is a special type for timestamp fields instead of VarChar, but this is a different topic... Now I have to create a report with iReport 2.0.2 in which the timestamp should be shown as a normal date/time value. I've "googled" but doesn't find something which can halp me about this topic. Greets Christian
×
×
  • Create New...