Bug 6803

Summary: [ 517014 ] Files created w. POI 1.2 crashes excel
Product: POI Reporter: Andy Oliver <poi-support>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.0.2   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Andy Oliver 2002-03-01 21:17:27 UTC
[ 517014 ] Files created w. POI 1.2 crashes excel
Email:    (?)
Date:
2002-02-13 07:19 Priority:
5
Submitted By:
Lorenzo Resta (lresta) Assigned To:
Glen Stampoultzis (gstamp)
Category:
HSSF API Status:
Open
Summary:
Files created w. POI 1.2 crashes excel
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

Add A Comment:
Please log in!

If you cannot login, then enter your email address here:

DO NOT enter passwords or confidential information in your message!

Followups:

Message

Date: 2002-02-14 06:31
Sender: lresta
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());
}

}

Date: 2002-02-13 08:03
Sender: acoliver2
Logged In: YES 
user_id=287767

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

-Andy

Attached Files:
Name Description Download
Country3.XLS Download
Changes:

Field Old Value Date By
File Added 17807: Country3.XLS 2002-02-13 07:19 lresta
Comment 1 Glen Stampoultzis 2002-03-12 11:41:57 UTC
This seems to be working with 1.5 prerelease (I could not reproduce it at any 
rate).  Could you try again please?
Comment 2 Glen Stampoultzis 2002-03-30 23:49:49 UTC
Since no further correspondence on this bug has been provided and I have been 
unable to reproduce the problem I am closing this bug.