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 44461] New: - shiftRows don't copy the CellStyle
Date Thu, 21 Feb 2008 10:41:52 GMT
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=44461>.
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=44461

           Summary: shiftRows don't copy the CellStyle
           Product: POI
           Version: 3.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: sven.nissel@delphi.com


If I use HSSFSheet#shiftRows() it will not copy the CellStyle of the row befor. 

I fix it very bad and slowly this way:
public void insertRowAfter(int rowNum) {
		HSSFRow row = sheet.getRow(rowNum);
		sheet.shiftRows(rowNum + 1, sheet.getLastRowNum(), 1, true, true);
		
		HSSFRow newRow = sheet.getRow(rowNum + 1);
		for (short i = 0; i <= row.getLastCellNum(); i++) {
			HSSFCell cell = row.getCell(i);
			HSSFCell newCell = newRow.getCell(i);
			if (cell != null) {
				if (newCell == null)
					newCell = newRow.createCell(i);
				newCell.setCellStyle(cell.getCellStyle());
			}
		}
	}

Is this a bug- or future- request?

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message