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 2003/01/15 06:30:34 UTC

DO NOT REPLY [Bug 16092] New: - HSSFRow.getLastCellNum 's problem

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

HSSFRow.getLastCellNum 's problem

           Summary: HSSFRow.getLastCellNum 's problem
           Product: POI
           Version: 2.0-dev
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: ye-faqiang@hq.mki.co.jp


Hi. 
    I'm using jakarta-poi-1.9.0-dev-20030114 and find a problem.
Is HSSFRow.getLastCellNum() the row's number of cells ?
If I read a new xls file, the result is right, but If I write
xls data like this, it get the number of cells - 1. 


//////////////////////////////////

		public setVal(row,col,val) {
			HSSFRow wRow = workSheet.getRow(row);
			HSSFCell wCell = wRow.createCell((short)col);
	
	        wCell.setCellType( HSSFCell.CELL_TYPE_STRING );
			wCell.setCellValue(value);
		}
		
		public excute() {
			setVal(0,0,"1");
			setVal(0,1,"2");
			setVal(0,2,"3");
			HSSFRow wRow = workSheet.getRow(0);
			System.out.println("LastNum is " + wRow.getLastCellNum
());
			...	
		}
		
		
		result:		LastNum is 2		(correct result is 3 ?)