Bug 27673 - RowRecord.getLastCol() returns correct value+1
Summary: RowRecord.getLastCol() returns correct value+1
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-FINAL
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-15 16:31 UTC by David Bigwood
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Bigwood 2004-03-15 16:31:03 UTC
Problem with the event driven XLS reader in HSSF. I believe the value returned 
by the RowRecord object for the last column used (indexed on 0) is incorrect. 
The value actually returned is the correct value + 1.

Snippet of code below (basically the simple event example in the docs):

public void processRecord(Record record) {
  switch (record.getSid()) {
    case RowRecord.sid :
      RowRecord rowrec = (RowRecord) record;
      System.out.println("Row number ["
        + rowrec.getRowNumber()
        + "], first col ["
        + rowrec.getFirstCol()
        + "] last col ["
        + rowrec.getLastCol()
        + "]");
  }
}
Comment 1 David Bigwood 2004-03-15 16:35:07 UTC
This bug actually refers to poi-2.5-final-20040302.jar - was not able to 
select that from the version drop-down above.
Comment 2 Andy Oliver 2004-03-15 16:52:53 UTC
Its actually not a bug.  This is what is in the Excel Record.  its supposed to
be LastCol+1.  Why?  Dunno, ask Microsoft :-)  This is actually mentioned in the
Excel 97 Dev guide too.