You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Khanh Vo <kh...@antin.com> on 2004/03/06 02:16:09 UTC

can HSSFCell and HSSFRow be an array?

Instead of doing:
HSSFRow row1 = sheet.createRow((short) 1);
HSSFRow row2 = sheet.createRow((short) 2);
HSSFRow row3 = sheet.createRow((short) 3);
HSSFRow row4 = sheet.createRow((short) 4);

I'm trying to have a loop create the rows and columns.


for (int r = 0; r < 2 ; r++ )
{
   HSSFRow row[r] = sheet.createRow((short) r);
   HSSFCell c00 = row.createCell((short) 0);
   HSSFCell c01 = row.createCell((short) 1); 
   HSSFCell c02 = row.createCell((short) 2); 
   c00.setCellValue("Sam");
   c01.setCellValue(100); 
   c02.setCellValue(200); 
}

This possible? 


Thanks
Khanh