poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 24215] New: - RuntimeException: UnImplemented Celltype -1 when handling excel-file.
Date Wed, 29 Oct 2003 12:31:23 GMT
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=24215>.
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=24215

RuntimeException: UnImplemented Celltype -1 when handling excel-file.

           Summary: RuntimeException: UnImplemented Celltype -1 when
                    handling excel-file.
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: poi@solita.fi


Excel sheet processing fails and causes:

java.lang.RuntimeException: UnImplemented Celltype -1
        at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.construct
Record(ValueRecordsAggregate.java:361)
        at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.getCell(V
alueRecordsAggregate.java:98)
        at org.apache.poi.hssf.model.Sheet.getValueRecord(Sheet.java:557)
        at org.apache.poi.hssf.usermodel.HSSFRow.getCell(HSSFRow.java:325)
        at bug.ExcelBug.main(ExcelBug.java:27) 

Sample file is provided an attachment.

Sample code:
-------------------------

package bug;

import java.io.FileInputStream;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class ExcelBug {
    
    public static void main(String args[]) {
        try {
            HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream
("test.xls")); 
    
            for (int sheetIndex = 0; sheetIndex < wb.getNumberOfSheets(); 
sheetIndex++) {
                HSSFSheet sheet = wb.getSheetAt(sheetIndex);
                int rows = sheet.getLastRowNum();
    
                for (int rowIndex = 0; rowIndex < rows; rowIndex++) {
                    
            
                    HSSFRow row = sheet.getRow(rowIndex);
                    int cells = row.getLastCellNum();
    
                    for (short cellIndex = 0; cellIndex < cells; cellIndex++) {
                        HSSFCell cell  = row.getCell(cellIndex);
                    }
                }
            }
            
        } catch(Throwable t) {
            t.printStackTrace();
        }
        
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org


Mime
View raw message