You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2006/07/07 14:13:10 UTC

DO NOT REPLY [Bug 39989] New: - the function removeRow doesnot work

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=39989

           Summary: the function removeRow doesnot work
           Product: POI
           Version: 3.0-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P1
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: dm.smirnov@gmail.com


hi! When I remove row there is an exception (see below)


example:
import java.io.FileOutputStream;
import java.io.IOException;

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

public class Test {

    public static void main(String[] args) {
        try {
            HSSFWorkbook wb = new HSSFWorkbook();
            HSSFSheet sheet = wb.createSheet();

            for (int i = 0; i < 10; i++) {
                HSSFRow row = sheet.createRow(i);
                HSSFCell c1 = row.createCell((short) 0);
                c1.setCellValue(new HSSFRichTextString("TEST"));
                HSSFCell c2 = row.createCell((short) 1);
                c2.setCellValue(new HSSFRichTextString("TEST2"));
            }

            sheet.removeRow(sheet.getRow(5));


            FileOutputStream out = new FileOutputStream("C:\\2.xls");
            wb.write(out);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}



exception:
java.lang.ArrayIndexOutOfBoundsException: 2144
	at org.apache.poi.util.LittleEndian.putNumber(LittleEndian.java:511)
	at org.apache.poi.util.LittleEndian.putShort(LittleEndian.java:244)
	at org.apache.poi.hssf.record.EOFRecord.serialize(EOFRecord.java:80)
	at org.apache.poi.hssf.model.Sheet.serialize(Sheet.java:719)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:937)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:875)
	at Test.main(Test.java:36)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


DO NOT REPLY [Bug 39989] - the function removeRow doesnot work

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=39989


amolweb@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From amolweb@yahoo.com  2006-08-29 14:39 -------
I did verify that this bug exists in 3.0-alpha2 jar.
However, this seems to be already fixed in SVN trunk.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/