freaky.
--- Begin Message ---
Bugs item #517014, was opened at 2002-02-13 07:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=406288&aid=517014&group_id=32701

Category: HSSF API
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Lorenzo Resta (lresta)
Assigned to: Glen Stampoultzis (gstamp)
Summary: Files created w. POI 1.2 crashes excel

Initial Comment:
Hi,

I tried to create Excel files POI-HSSF 1.2 and i am 
having following problem: Excel crashes immediately 
after opening the created file. This problem did not 
happen with POI 1.0.2. Funny enough POI 1.2 is able to 
open this without any problem.

I have attached the file that crashes Excel.

Thanks

Lorenzo

----------------------------------------------------------------------

>Comment By: Lorenzo Resta (lresta)
Date: 2002-02-14 06:31

Message:
Logged In: YES 
user_id=450634

Hi Andi,

Thanks for the quick reply. I tried to track the problem 
and now i believe to know where the problem lies:

If the read in Excel file had blank cells and i then change 
such a blank cell to a String type and set a value to that 
cell the then written Excel file is not readable by Excel 
or even crashes Excel. If i then reopen that modified file 
again with HSSF and immediately write it back, then Excel 
is able again to open it.

Cheers

Lorenzo


package com.forumedia.dwb.spreadsheet.adapter.excel;

import net.sourceforge.poi.hssf.usermodel.HSSFCellStyle;
import net.sourceforge.poi.hssf.usermodel.HSSFCell;
import com.forumedia.dwb.spreadsheet.StringCellIF;

public class ExcelStringCellAdapter extends  
ExcelCellAdapter implements StringCellIF {

protected ExcelStringCellAdapter(HSSFCell anExcelCell){
 super(anExcelCell);
}

public Object getValue(){
 return getExcelCell().getStringCellValue();
}

public void setValue(Object aValue){
        
//If cell is of type BLANK, change it to String
if(getExcelCell().getCellType() == HSSFCell.CELL_TYPE_BLANK)
{
  getExcelCell().setCellType(HSSFCell.CELL_TYPE_STRING);
}
                
getExcelCell().setCellValue(aValue.toString());
}

}

----------------------------------------------------------------------

Comment By: Andrew C. Oliver (acoliver2)
Date: 2002-02-13 08:03

Message:
Logged In: YES 
user_id=287767

Can you attach some sourcecode that demonstrates how you 
are creating workbooks?

-Andy

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=406288&aid=517014&group_id=32701
--- End Message ---

Reply via email to