Don't know the history, but the value is not that straightforward. If the cell has a specifically assigned format, it is used. However, format may also be derived from conditional formatting, which may not be evaluated in that context. In fact, conditional formatting evaluation is quite a recent addition to POI. I haven't checked, but since the same or similar formatting constructs are used, it could also come from theme or table styles.
On Sun, May 6, 2018, 20:55 Wilson de Carvalho <[email protected]> wrote: > Hi, everyone. > > I've been working in a solution with an implementation > of XSSFSheetXMLHandler.SheetContentsHandler interface and struggled with > date-formatted cells. I wonder why the format code that is present in the > style file is not provided in method > > public void cell(String cellReference, String formattedValue, XSSFComment > comment), > > thus making it something like: > > public void cell(String cellReference, String formattedValue, XSSFComment > comment, String formatString) > > > It would greatly improve user code flexibility if the format string that is > used to define a cell was also provided in this method. It would avoid the > need of extending org.xml.sax.helpers.DefaultHandler when the sole purpouse > is to have access to the cell format string. > > Any thoughts or considerations? > > > Regards, > > -- > Wilson de Carvalho. >
