I do not know if this is the most efficient way of working through this prob but it is a possible work around. >From the excel sheet read the cell contents as string, integer or whatever is the appropriate data type. Now suppose the value in a particular cell is of string data type, u have a string object with you. Then using the normal java APIs, getFont(String object) you can get a font object. >From this you can get the font attributes like size, style, font name. I am not available about the strikethrough part though. There is a method called getAttributes() in the Font class which returns a map object. I am not sure if this would contain any strikethrough information.
In case you find any other soln please let me know! Regards, Suchitra. -----Original Message----- From: D Minor9th [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 4:44 PM To: [email protected] Subject: Reading font fromat from cell I'm trying to determine if the content of a cell has been struck through. There does not seem to be a getFont() method in HSSFCell, which would appear to provide what I need, since HSSFFont provides a getStrikeout() method. I tried using HSSFCell.getCellStyle().getFontIndex() but the resulting fontindex appears not to be consistent between excel files for a given font format. The fontindex I get in one file for strikeout appears to be 12 for Arial Font, Regular Font style, Size 10, Colour Automatic, Underline None. However the fontindex I get for the same font format in another file is 8 ! Is the getFontIndex() the correct API to use to determine this strikethrough information, and if so does anyone know why I'm getting these inconsistent results ? Even better, do any of the POI developers know when/if a HSSFCell.getFont() method will be implemented ? thanks, Deepak --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
