| Issue 198: | JEXCEL export of number columns as text. EXCEL does it right | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Hi again, I was using JEXCEL for my exports when I noticed that it has a problem when exporting number fields. The exported excel always complains about numbers being written as text. This can be fixed in the excel but it's a bit annoying if you have several number columns with hundreds of records... I tried EXCEL export and it hadn't that problem. So I moved to EXCEL export now... Probably is not a Jmesa's problem but I just wanted to point out this issue in case something can be done to fix it. Cheers, Alex
Jun 1, 2009
Project Member
#1
jeff.johnston.mn@gmail.com
Jun 9, 2009
org/jmesa/view/jexcel/JExcelView.java : Line 131 -> 136
WritableCell cell = null;
if (value instanceof Number) {
cell = new Number(colidx++, rowidx, Double.valueOf(value.toString()), rowFmt);
} else {
cell = new Label(colidx++, rowidx, value + "", rowFmt);
}
The class Number is use for java.lang.Number and for jxl.write.Number with only the
second in import.
So when he test if "value" is "Number" (jxl.write.Number), it's always return false.
Solution : change line 132 to :
if (value instanceof java.lang.Number) {
Jun 10, 2009
Thank you! I checked this into the trunk. It should go out soon too as I do really need to do another release for small things like this.
Jun 11, 2009
Part of the 2.4.3 release.
Status:
Fixed
|