Re: Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Renjith R
Since I am working at XSSF + SAX level, I am able to get the format of that particular cell by accessing the Styles table using the following code. XSSFCellStyle style = styles.getStyleAt(styleIndex); String formatString = style.getDataFormatString(); System.out.println(formatString); This gave m

RE: Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Crocker, David
ating the excel date for MM/dd/ format On Fri, 25 Apr 2014, Renjith R wrote: > I have to accept the first one and reject the second. > Since excel stores both these values in integer format, I am not able > to differentiate them. Simple - fetch the cell style that applies to the

Re: Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Nick Burch
On Fri, 25 Apr 2014, Renjith R wrote: I have to accept the first one and reject the second. Since excel stores both these values in integer format, I am not able to differentiate them. Simple - fetch the cell style that applies to the cell, get the formatting string that it uses, and see if th

Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Renjith R
Hi, I am using Apache POI to read Excel file(.xlsx) and validate its contents. We are having a date field in excel whcih should be in format MM/dd/. Suppose if the date fild has two values as follows, 1) 04/