Community
Participate
Working Groups
Created attachment 95460 [details] The preview result in 2.2.2. By using the design file attached in https://bugs.eclipse.org/bugs/show_bug.cgi?id=225693 in BIRT 2.3, the preview result showed that some data became 0. However, the data can be viewed correctly in BIRT 2.2.2. First doubted this is a Rhino upgrade problem. However, after replaced js.jar from 2.2.2 to 2.3, the problem remained.
Created attachment 95461 [details] The preview result in 2.3
For Rhino java script engine, it actually cannot correctly compare a java.sql.Date value with its native Date value. All those comparison will result a "false". In 2.2.2 we convert all the java.sql.Date and java.sql.Time to java script Date, so that for an expression like dataSetRow["Date"] > new Date() can be correct evaluated. This however is actually incorrect. Take following example: java.sql.Date: 1999-10-10, when being convert to a native date value, would be 1999-10-10 12:00:00. If it is then compare to a date value 1999-10-10 12:00:01, the result is "less than". However, for a Date value, only the date field rather than time field should be significant during comparison. That is, user will expect 1999-10-10 equals to 1999-10-10 12:00:01. This kind of comparison can only be done by Data Engine rather Rhino by now. So we should not convert a java.sql.Date value to a Rhino native date, rather, we should keep its value as it is. In 2.2.2, even if this kind of comparison is supported, the comparison result is actually inconsistent with what user expected. Mark the bug as won't fix. User can always work around the problem by convert dataSetRow["Date"] to a java script Date value.
*** Bug 227291 has been marked as a duplicate of this bug. ***