DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27445>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27445

I get Array index out of range when I inquiry on the cell format of a cell where the 
style is 165

           Summary: I get Array index out of range when I inquiry on the
                    cell format of a cell where the style is 165
           Product: POI
           Version: 1.0.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I am reading an Excel file where I need to know if a certain cell contains the 
percentage format. I am using poi-2.5-final-20040302.jar. If you need to 
contact me my phone is 561-241-4180. I wish I could include the file, but I do 
not see a way. Here are the displays when the error occurs:

Cell Type 0
style is 165 cell value 0.016
Exception caught  Array index out of range: 165

Here is the source code I am using:
private void displayCellFormat(HSSFCell cell, int type) {
        System.out.println("Cell Type " + type);
        try {
              HSSFCellStyle cs = cell.getCellStyle();
              short format = cs.getDataFormat();
              if (type == 0) {
                System.out.println("style is " + format + " cell value " +      
                                            cell.getNumericCellValue()); 
              }
              else {
                System.out.println("style is " + format + " cell value " +      
                                            cell.getStringCellValue()); 
              } 
              String formatStr = HSSFDataFormat.getBuiltinFormat(format);
              System.out.println("format " + formatStr); 
        }catch (Exception e) {
                System.out.println("Exception caught  " + e.getMessage()); 
        }                               
}

Thanks again. I love the name you gave the package HSSF.

Dora

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to