https://issues.apache.org/bugzilla/show_bug.cgi?id=57231
Bug ID: 57231
Summary: clone worksheet throws exception: The class
org.apache.poi.hssf.record.ArrayRecord needs to define
a clone method
Product: POI
Version: 3.10-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 32210
--> https://issues.apache.org/bugzilla/attachment.cgi?id=32210&action=edit
workbook containing hidden MASTER sheet, that I am trying to clone.
public void addNewWorksheet4() {
FileInputStream fileIn = null;
FileOutputStream fileOut = null;
int idx;
int foundIdx;
try
{
fileIn = new
FileInputStream(Environment.getExternalStorageDirectory()+File.separator +
"uesystems/leakmgr/MixedGasReport.xls");
POIFSFileSystem fs = new POIFSFileSystem(fileIn);
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = null;
foundIdx = locateWorkSheetByName(wb, "master");
HSSFSheet newSheet = wb.cloneSheet(foundIdx);
idx = wb.getSheetIndex(newSheet);
wb.setSheetName(idx, "newName");
// Write the output to a file
fileOut = new
FileOutputStream(Environment.getExternalStorageDirectory()+File.separator +
"uesystems/leakmgr/MixedGasReport2.xls");
wb.write(fileOut);
}
catch(FileNotFoundException ex) {
Log.v(TAG, "FileNotFoundException: " + ex.toString());
}
catch(IOException ex) {
Log.v(TAG, "IOException: " + ex.toString());
}
catch(Exception ex) {
Log.v(TAG, "Exception: " + ex.toString());
}
finally {
if (fileOut != null) {
try {
fileOut.close();
}
catch(Exception ex) {
}
}
if (fileIn != null) {
try {
fileIn.close();
}
catch(Exception ex) {
}
}
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]