Bug 49096 - Error when using clonesheet
Summary: Error when using clonesheet
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
: 49415 (view as bug list)
Depends on:
Reported: 2010-04-12 09:06 UTC by Pilekes
Modified: 2010-06-15 07:14 UTC (History)
2 users (show)

BeginRecord.class (1.19 KB, application/octet-stream)
2010-04-12 10:47 UTC, Pilekes
Excel report (35.50 KB, application/vnd.ms-excel)
2010-04-15 07:43 UTC, Pilekes
Example Sheet that produces the exception (14.00 KB, application/vnd.ms-excel)
2010-05-31 08:04 UTC, michael.harjes

Note You need to log in before you can comment on or make changes to this bug.
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...

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]

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)