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/08/18 15:58:44 UTC

DO NOT REPLY [Bug 40285] New: - CellIterator Skips First Column

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=40285>.
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=40285

           Summary: CellIterator Skips First Column
           Product: POI
           Version: 3.0-dev
          Platform: All
        OS/Version: other
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: apache@haimsoft.com


The CellIterator inner class (of HSSFRow, line 436) will skip the first cell.

Problem being: 
- nextId begins at 0
- the constructor calls findNext()
- findNext increments nextId before selecting the first populated cell.

Quick and easy fix is to default nextId to -1 so findNext() will increment to 0
first time around.

Not quite sure how to submit code changes, so thought this would do the job
(marked as PatchAvailable).

-- 
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 40285] - CellIterator Skips First Column

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=40285>.
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=40285





------- Additional Comments From ssb_jakarta@360works.com  2006-11-09 10:49 -------
I've also experienced this behavior. Attaching a code snippet:

	private String extractExcel( InputStream stream ) throws IOException {
		HashSet set = new HashSet();
		HSSFWorkbook workbook = new HSSFWorkbook(stream);
		int sheetCount = workbook.getNumberOfSheets();
		int resultLength = 0;
		for( int i = 0 ; i < sheetCount ; i++ ) {
			//System.out.println( "Reading sheet #" + (i+1) );
			HSSFSheet at = workbook.getSheetAt( i );
			int rowCount = at.getPhysicalNumberOfRows();
			for (int j = 0; i< rowCount; j++)  {
				//System.out.println( "Reading row #" + (j+1) );
				HSSFRow row = at.getRow( j );
				if (row == null) break;
				for( Iterator iterator = row.cellIterator(); iterator.hasNext(); ) {
					HSSFCell cell = (HSSFCell)iterator.next();
					if( cell.getCellType() == HSSFCell.CELL_TYPE_STRING ) {
						String string = cell.getRichStringCellValue().getString();
						if( string != null && string.length() > 0 ) {
							if (set.add( string )) {
								resultLength += string.length();
								resultLength++;
							}
						}
					}
				}
			}
		}
		StringBuffer result = new StringBuffer(resultLength);
		for( Iterator iterator = set.iterator(); iterator.hasNext(); ) {
			result.append( (String)iterator.next() ).append( ' ');
		}
		return result.toString();
	}


-- 
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 40285] - CellIterator Skips First Column

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=40285>.
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=40285


jheight@apache.org changed:

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




------- Additional Comments From jheight@apache.org  2006-08-25 22:22 -------
Good catch. Keep it up. Applied to Svn. Feel free in inspect and comment if
reuqired.

Jason

-- 
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 40285] - CellIterator Skips First Column

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=40285>.
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=40285


cam@rocketdog.com.au changed:

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




------- Additional Comments From cam@rocketdog.com.au  2006-10-01 00:37 -------
This bug is still in the 3.0-alpha2-20060616 

-- 
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 40285] - CellIterator Skips First Column

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=40285>.
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=40285


avik@apache.org changed:

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




------- Additional Comments From avik@apache.org  2007-01-16 01:46 -------
Works as of 12Jan2007, Testcase added. 
http://issues.apache.org/bugzilla/show_bug.cgi?id=41366

Please verify!

-- 
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/