Bug 49096

Summary: Error when using clonesheet
Product: POI Reporter: Pilekes <chris.pijl>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: michael.harjes, torsten.haase
Priority: P2    
Version: 3.6-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: BeginRecord.class
Excel report
Example Sheet that produces the exception

Description Pilekes 2010-04-12 09:06:23 UTC
I get the following error message when using WorkBook.CloneSheet with POI 3.6:

The class org.apache.poi.hssf.record.chart.BeginRecord needs to define a clone method null 

When I use POI 3.2-FINAL it copies the sheet including chart perfectly, except for the fact that the cloned chart points to the original page...

I was hoping this was resolved in 3.6, but after reviewing some posts on the subject, it probably isn't...

Cheers
Comment 1 Nick Burch 2010-04-12 10:39:56 UTC
Could you please upload a problematic file? We'll need it to be able to debug the problem, as well as to be able to write a unit test to then ensure it doesn't get broken again in the future!

(It would seem a few charting records will need the clone feature added, but we need a real file to discover which)
Comment 2 Pilekes 2010-04-12 10:47:17 UTC
Created attachment 25268 [details]
BeginRecord.class

I'm hoping that this is the file you want...
Since I'm using CF8 to fill an Excel template-sheet and cloning this sheet with poi CloneSheet...
Which in turn errors on the BeginRecord class...
Comment 3 Nick Burch 2010-04-12 10:56:15 UTC
It's the excel file that gives the error that we need....
Comment 4 Pilekes 2010-04-15 07:43:19 UTC
Created attachment 25302 [details]
Excel report
Comment 5 michael.harjes 2010-05-31 08:04:30 UTC
Created attachment 25501 [details]
Example Sheet that produces the exception

We have the same Problem. I have added an example sheet that can not be cloned.

This is the Code i have used to clone the sheet:

HSSFSheet tempSheet = excelWBTemplate.cloneSheet(0);
Comment 6 Nick Burch 2010-06-02 12:02:55 UTC
Fixed in r950611.

Note that there may be some more work needed to ensure that both sheets behave sensibly in excel after the clone (patches welcome!), but no exceptions are now thrown
Comment 7 Nick Burch 2010-06-09 14:12:44 UTC
*** Bug 49415 has been marked as a duplicate of this bug. ***
Comment 8 Pilekes 2010-06-15 05:25:30 UTC
And how do I implement this fix?
Comment 9 Nick Burch 2010-06-15 07:14:56 UTC
Use a svn checkout build / nightly build / wait for 3.7 beta 1 (hopefully due in a week)