I'm running into a bug with the file size of the outputfile.
I have a template excel file that's about 1 megabyte in size of just plain unformatted 
data on sheet one.
I'm reading this file in and then removing all the rows from sheet one and writing to 
a output file.
The output file size is listed as 500K, but it has NO data at all.  It is completely 
empty.
When I go ahead and click the "Save" button in excel and close the spreadsheet, the 
size shrinks to 14K.

Is this a bug or am i doing something wrong?  
Why is the output file size so big even though there's no data at all ?


___________________My Code Start____________________

POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("c:/bigfile.xls"));
HSSFWorkbook hssfworkbook = new HSSFWorkbook(fs);
HSSFSheet        sheet  = hssfworkbook.getSheetAt(0);
                                                
                        
// Create outputstream for excel file
FileOutputStream stream = new FileOutputStream("c:/smallfile.xls");

int numberRows = sheet.getLastRowNum()+1;
for (int k = 0; k < numberRows; k++)
{
        HSSFRow row = sheet.getRow(k);
      if (row != null) {
        sheet.removeRow(row);
        }
}

hssfworkbook.write(stream);
stream.close();

___________________My Code End______________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to