Bug 26858

Summary: Clone sheet with formulaes
Product: POI Reporter: Amol Athavale <amolathavale>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 2.0-pre2   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Amol Athavale 2004-02-11 14:01:25 UTC
Hi there,

I am trying to create a report in Excel using POI. I read an Excel file as a 
template which also contins formulaes. Then I have to create around 15 Sheets 
dynamically for the report, in the same workbook.

I create the first sheet successfully, and for the next on, I simply clone the 
first one. I found that if the first sheet contains formula, (in my case, it is 
simple SUM() function ) it gives me a funny exception as 

-- java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0

When I remove the formaulaes, it works fine !!! I also tried to enter the 
formulaes using cell.setCellFormula() method, but the exception occus again.


Cheers - Amol Athavale
Comment 1 Avik Sengupta 2004-02-11 14:03:32 UTC
Seems like a valid bug, but I would request you to test this with 2.0 final and
report that result. Thanks. 
Comment 2 Amol Athavale 2004-02-11 14:05:08 UTC
I use the 2.0 final release only...
Comment 3 Josh Micich 2008-05-23 02:06:35 UTC
Retested OK in 3.1-beta2

I couldn't reproduce the AIOOBE, but I can see that on 2.0 and 2.5.1 formula cells were not copied across during a clone sheet operation.  From 3.0 onwards this seems to be fixed.