After searching a little bit more, i've tried the "Yegor" version with same result:

Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Number
    at java.text.DecimalFormat.format(Unknown Source)
    at java.text.Format.format(Unknown Source)
at org.apache.poi.ss.usermodel.DataFormatter.formatRawCellContents(DataFormatter.java:428) at org.apache.poi.xssf.eventusermodel.XLSX2CSV$MyXSSFSheetHandler.endElement(XLSX2CSV.java:451)

Does anybody has a fix or an idea to test ?

Le 19/02/2010 16:55, Prenom Nom a écrit :
Hi, i think i've found a bug in the sample code given by "Chris Lott" (the 13 May 2009 version). I got the following exception:

Caused by: java.lang.IllegalArgumentException: Cannot format given Object as a Number
    at java.text.DecimalFormat.format(Unknown Source)
    at java.text.Format.format(Unknown Source)
at org.apache.poi.ss.usermodel.DataFormatter.formatRawCellContents(DataFormatter.java:428) at ...ClasseurExcel2007$LecteurOnglet.endElement(ClasseurExcel2007.java:229)

The call was:
org.apache.poi.ss.usermodel.DataFormatter.formatRawCellContents(39448, 214, "mmm\'yy")

which is located at:

                case NUMBER:
                    String n = characters.toString();
                    if (this.formatString != null)
thisStr = formatter.formatRawCellContents(Double.parseDouble(n), this.formatIndex, this.formatString);


There must be a mistake since the "NUMBER" case and the date format passed doesn't seem to mix well. So is there a better version of XLSX2CSV right now ?

NB: the POI version i use is 3.6 lastest release




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to