Project: Birt
Bug 242676 GetGlobalVariable return String type even if the globalvalue is double type
Reported: 2008-07-31 04:13:15 | Status: closed wontfix

Description: GetGlobalVariable return String type even if the globalvalue is double type Build number: 2.3.1.v20080731-0630 Steps to reproduce: 1, In report's initialize defined script: reportContext.setGlobalVariable("a", 123); reportContext.setGlobalVariable("b", 456); c = reportContext.getGlobalVariable("a"); d = reportContext.getGlobalVariable("b"); 2, New two Float type data items: data1 and data2 3, data1's expression is a+b; data2's expression is c+d 4, Preview Actual result: The result of data1 is 579.0, the result of data2 is very strange: 123.0456. I think when using reportContext.getGlobalVariable, the value 123 and 456 are considered as String type and the + operation is joint these two value as one String. Error log:

Files changed in fix:
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ExecutionContext.java