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

steve.whitson

Members
  • Posts

    14
  • Joined

  • Last visited

steve.whitson's Achievements

Apprentice

Apprentice (3/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Oops! I meant thos to be of a higher priority, such as 2. The version of JasperServer I\'m using is 2.1.0. The other version info: java se 1.5.0_14 (upgraded today from 08) tomcat 5.5.20 jasperserver 2.1.0
  2. The problem has re-occurred. Now, I am able to reproduce the problem fairly easily. First I restart tomcat, then run the report that uses Date/Time, and the time is fine. Next, I run a copy of the report which takes Date inputs instead of Date/Time... and that's when the problem will definitely occur. Now, I run the first report again, and problem is still present there too. I did file this as a bug. Odd set of circumstances. Thanks much for you help, -Steve
  3. Well, Date does seem to work as I had originally expected Date/Time would (Yea!). Why using Date/Time passes in a String (from the JasperServer Input Control) doesn't makes sense to me. Although, using Date does not supply my need (in some places) for a time-picker. Odd though... doing this (using Date) brings out the time-zone offset bug (mentioned earlier) every time (filing a bug report for both). Lucian, thanks much for your help! :) -Steve
  4. I'm not sure if this is a question for JasperServer or iReports (server plug-in). I've setup a couple reports that each take date-time inputs (From and To). These are String parameters in the report. In JasperServer the Input Control I used is Single Value, having a DataType of Date/Time. The string the report receives from this JasperServer interface is in the form (EEE MMM dd HH:mm:ss zzz yyyy). I found this could be parsed out to a Timestamp in another non-prompted parameter using this: Code: new java.sql.Timestamp(((new SimpleDateFormat("EEE MMM dd HH:mm:«»ss zzz yyyy"«»)).parse($P{From})).getTime()) This works just fine. Now, when I execute this same report using the plugin (Run Report Unit), the string passed in through this Input Control is the time in milliseconds. My non-prompting parameter then throws an exception. It is not able to parse out this millisecond string. 15:17:12,998 ERROR ManagementService,http-8080-Processor23:1159 - caught Throwable exception: Error evaluating expression : Source text : new java.sql.Timestamp(((new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy")).parse($P{From})).getTime()) com.jaspersoft.jasperserver.api.JSExceptionWrapper: java.text.ParseException: Unparseable date: "1199167200000" at java.text.DateFormat.parse(DateFormat.java:335) at ToolStateVisualization__1202237109587_1202237165973_541843.evaluate(ToolStateVisualization__1202237109587_1202237165973_541843:175) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:537) I would expect that the two ways of running the report on the server would work the same, and pass in identical strings. Am I doing something wrong, or possibly is there more I can do here? Thanks much, -Steve
  5. I've been unable to reproduce the problem since my linux box rebooted yesterday. Also couldn't reproduce it on the target user's system today. Odd how easily it reproduced before the reboot. Just for noting, the system it occurred on: java se 1.5.0_08 tomcat 5.5.20 jasperserver 2.1.0 centos 4.6, kernel 2.6.9-55 If/when I reproduce the problem I'll file a ticket. Thanks again for your help! -Steve Post edited by: steve.whitson, at: 2008/02/07 18:39
  6. Shall I file a bug ticket, or should I wait for more feedback from you? Thanks much for you help, -Steve
  7. I have two data sources. One is for a mysql database, and the other for db2 (db2 is what this report uses). Neither db system sets any timezone, the default timezone of the OS is used in both cases (local timezone, CST6DST). I'm not sure if this answers your question. I have not done anything special with regard to specifying a timezone with either of these two JDBC datasource configurations in jasperserver. Thanks much, -Steve
  8. Hi, I have a variable that doesn't get populated with data until after the next record is being processed. It seems to always be one behind. Here's my scenario... I have a report with a pair of variables (starttime and endtime) that get their values fields or parameters based on a decision, as follows (from the Variable Expression). Code: starttime: $F{starttime}.getTime() < $P{fromTimestamp}.getTime() ? $P{fromTimestamp} : $F{starttime} endtime: $F{endtime}.getTime() > $P{toTimestamp}.getTime() ? $P{toTimestamp} : $F{endtime} I then have another variable (stateduration) that is the difference between these two variables. Code:[code] new Long(($V{endtime}.getTime() - $V{starttime}.getTime())/1000) The problem I am having is that the stateduration variable does not get a value until the next returned record is being processed. It is off by one. Is there some order in which variables get evaluated? I have solved my problem by putting the full starttime expression and endtime expression in place of $V{starttime} or $V{endtime} as in: Code:[code] new Long(( ($F{endtime}.getTime() > $P{toTimestamp}.getTime() ? $P{toTimestamp}.getTime() : $F{endtime}.getTime()) - ($F{starttime}.getTime() < $P{fromTimestamp}.getTime() ? $P{fromTimestamp}.getTime() : $F{starttime}.getTime()) )/1000) Can anyone help me understand what is going on here? Thanks much, -Steve Post edited by: steve.whitson, at: 2008/02/01 15:30 Post edited by: steve.whitson, at: 2008/02/01 15:32
  9. Hi, I have experienced some trouble with a Text field being populated with a Date/Time DataType input control. I am converting the passed in parameter (text date/time string) to a Timestamp in a sibling parameter with the following formula in the Default Value Expression. Code: new java.sql.Timestamp(((new SimpleDateFormat("EEE MMM dd HH:mm:«»ss zzz yyyy"«»)).parse($P{From})).getTime()) The Date/Time DataType InputControl fields/parameters (prompted for) are 'From' and 'To'. The fromTimestamp parameter is produced using this formula. The same thing occurs with the toTimestamp parameter. These fromTimestamp and toTimestamp parameters are not prompted for. When I log the queries, the log shows that the date/time is correct most of the time. Once in a while the time changes to be -6 hours (the time zone offset for here). I just reproduced the problem. Here's from the log: First try: 09:04:34,201 DEBUG JRJdbcQueryExecuter,http-8080-Processor24:206 - Parameter #1 (toTimestamp of type java.sql.Timestamp): 2008-01-07 00:00:00.0 09:04:34,203 DEBUG JRJdbcQueryExecuter,http-8080-Processor24:206 - Parameter #2 (fromTimestamp of type java.sql.Timestamp): 2007-12-31 00:00:00.0 Second try: 09:04:50,118 DEBUG JRJdbcQueryExecuter,http-8080-Processor25:206 - Parameter #1 (toTimestamp of type java.sql.Timestamp): 2008-01-06 18:00:00.0 09:04:50,119 DEBUG JRJdbcQueryExecuter,http-8080-Processor25:206 - Parameter #2 (fromTimestamp of type java.sql.Timestamp): 2007-12-30 18:00:00.0 I didn't change my input parameters (passed into 'From' and 'To'). This was done using the JasperServer interface (v2.1.0). I did nothing more than press the 'Report Options' button, and re-submit the same info. 12 successive submissions following this did not reproduce the problem. Then on the next submission, there it was again. Is there a bug? Am I don't something wrong? Thanks much, -Steve
  10. The domainAxis is what I was after, not the rangeAxis. As in: Code: DateAxis domainAxis = (DateAxis) ((XYPlot) jFreeChart.getPlot()).getDomainAxis(); Timestamp fromParam = (Timestamp) this.getParameterValue("From"«»); Timestamp toParam = (Timestamp) this.getParameterValue("To"«»); domainAxis.setRange(fromParam.getTime(), toParam.getTime()); This correctly returns the DateAxis I was after, which held resonable numbers. Setting the Range (or max/min) to my 'from' and 'to' parameters did the trick! Post edited by: steve.whitson, at: 2008/01/24 20:33 Post edited by: steve.whitson, at: 2008/01/24 21:52 Post edited by: steve.whitson, at: 2008/01/24 21:53
  11. Hi, I'm trying to create a chart using a given time period (from and to) passed in as parameters. This is a simple visualization of when states start and end over time. The time-periods returned will overlap these input values, since the state may have started prior to the time period queried for. state starttime endtime state1 2008-01-01 00:00:00 2008-01-02 01:00:00 state2 2008-01-02 01:00:00 2008-01-02 01:55:00 state1 2008-01-02 01:55:00 2008-01-03 00:01:00 I need to ensure the chart only displays values from 00:00:00 to 00:00:00 of the next day. If I seed the database with 0-length states (starttime=endtime) the chart lays out like I want. It starts at 00:00 and ends on the next day at 00:00. With the real data, it does not. It starts at like 03:00 and ends at 22:00, or 01:00 - 22:00... depending on the data retrieved. I've tried using the customize method an extension of JRAbstractChartCustomizer. Here's what I tried: Code: Timestamp fromParam = (Timestamp) this.getParameterValue("From"«»); NumberAxis rangeAxis = (NumberAxis) ((XYPlot) jFreeChart.getPlot()).getRangeAxis(); rangeAxis.setLowerBound(fromParam.getTime()); This doesn't do what I need. I've examined the value returned from getLowerBound and getUpperBound, which are 0.0 and 1.05 respectively. This doesn't seem related to a time-period. Can someone please help me out here? Other ideas are to somehow inject a state into the dataset within the customize method, imitating my seeding... but I have no idea how to do this. Thanks much, -Steve Post edited by: steve.whitson, at: 2008/01/24 21:52
  12. Hi, I'm trying to setup a db2 datasource but the system doesn't seem to find my DB2Driver class. ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver The db2java.zip file, or jarred db2java.jar in the lib folder doesn't solve the problem. I've tried unpacking and placing the COM folder in a classes folder (under iReports), placing the COM folder in the root of iReports. Nothing seems to allow the class to be found. I've used the MySQL driver, Oracle and others just fine doing this (jar in lib). Any help here would be greatly appriciated! :) -Steve
×
×
  • Create New...