I am trying to write a Java collection to an excel document. Here is my code,
but I only get a single row created in the excel. What am I doing
incorrectly?

[code]
                while(iterator.hasNext()) {
                        Rule rule = (Rule)iterator.next();
                        
                        HSSFRow row = sheet.createRow((short)rowNumber++);
                                                
                        HSSFCell cell = row.createCell((short) 0);
                        cell.setCellStyle(cellStyle);
                        cell.setCellType(HSSFCell.CELL_TYPE_STRING);
                        cell.setCellValue(rule.getNum());
                        
                        cell = row.createCell((short) 1);
                        cell.setCellStyle(cellStyle);
                        cell.setCellType(HSSFCell.CELL_TYPE_STRING);
                        cell.setCellValue(rule.getDescription());
                        
                        cell = row.createCell((short) 2);
                        cell.setCellStyle(cellStyle);
                        cell.setCellType(HSSFCell.CELL_TYPE_STRING);
                        cell.setCellValue(rule.getType());
                }

[/code]
-- 
View this message in context: 
http://old.nabble.com/Only-single-row-gets-created-in-my-excel-tp26881426p26881426.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to