My test spreadsheet has dates in cells marked up as style #2. Dale
Monti's has dates marked up as style #1. I learned more about cell
styles from this web site, which has a very useful HTML version of the
ECMA 376 standard:
http://openiso.org/Ecma/376/Part4/3
I bet that a decent XLSX2CSV program has to use the
XSSFReader#getStylesTable() method, and then call
StylesTable#getCellStyleXfAt() with the value of the cell's "s"
attribute. Here they were 1, 2, etc. Unfortunately the POI javadoc has
only the signature for that method, no explanation. The return value is
of type org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf which I
will have to dig more to find.
So here's my question to the list. I have used DateUtil#isADateFormat()
to interpret cell styles on HSSF sheets. That takes a format index
and a format string. The doc doesn't indicate whether it works as well
on XSSF sheets. What format string do I need to get from the styles table?
Or is there something else?
Please advise, thanks.
chris...
Dale Monti wrote:
Hi,
I was trying this example. My spreadsheet has a date. I just typed in
5/18/09 and Excel automatically formated it. It is cell B2. But there
doesn't seem to be anything to indicate it is a date field. How can I
know it is a date field?
- <row r="2" spans="1:2">
- <c r="A2">
<v>1.43</v>
</c>
- <c r="B2" s="1">
<v>39951</v>
</c>
</row>
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]