Bug 17474 - Method cloneSheet not working on sheets with diagrams
Summary: Method cloneSheet not working on sheets with diagrams
Status: RESOLVED DUPLICATE of bug 15050
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-27 11:18 UTC by Henning Boeger
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henning Boeger 2003-02-27 11:18:13 UTC
If I have a simple Excel file with a single sheet with a diagram in it,
try to clone it, I get the following Exception:

java.lang.RuntimeException: The class org.apache.poi.hssf.record.ProtectRecord 
needs to define a clone method
	at org.apache.poi.hssf.record.Record.clone(Record.java:247)
	at org.apache.poi.hssf.model.Sheet.cloneSheet(Sheet.java:291)
	at org.apache.poi.hssf.usermodel.HSSFSheet.cloneSheet
(HSSFSheet.java:149)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet
(HSSFWorkbook.java:351)

There is no encryption used in the book, it is a simple Excel file created from 
scratch (Using Excel 2000 SR-1). I read and write the file using the following 
code:

HSSFWorkbook book = new HSSFWorkbook(new FileInputStream(path));
book.cloneSheet(0);
FileOutputStream fOut = new FileOutputStream(XLS_PATH + XLS_OUT);
book.write(fOut);
fOut.close();

The POI version I use is
jakarta-poi-1.11.0-dev-20030225.jar
Comment 1 Avik Sengupta 2003-02-27 13:32:53 UTC
Add protect record to the list. Also, this needs to be documented for people
writing new records. 

*** This bug has been marked as a duplicate of 15050 ***