Issue 198: JEXCEL export of number columns as text. EXCEL does it right
Status:  Fixed
Owner: ----
Closed:  Jun 2009
Reported by AlejaV...@gmail.com, May 26, 2009
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
Thanks for the heads up...if I remember correctly the two exports were done by two
different developers so they may be inconsistent.

Jun 9, 2009
#2 Vena...@gmail.com
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
Project Member #3 jeff.johnston.mn@gmail.com
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
Project Member #4 jeff.johnston.mn@gmail.com
Part of the 2.4.3 release.
Status: Fixed