Bug 54294 - setSheetOrder on cloned sheet and deleting original sheet clears all sheets in saved file
Summary: setSheetOrder on cloned sheet and deleting original sheet clears all sheets i...
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-14 00:25 UTC by magnus
Modified: 2013-08-23 18:26 UTC (History)
0 users



Attachments
Code to recreate problem and two simple workbooks (3.69 KB, application/x-zip-compressed)
2012-12-14 00:25 UTC, magnus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description magnus 2012-12-14 00:25:54 UTC
Created attachment 29753 [details]
Code to recreate problem and two simple workbooks

I clone a sheet and then try to place the cloned sheet at the index where the original was. This is repeated a number of times and finally the original sheet is removeed (I want to allow a user to specify a template where one sheet may have to be repeated in the resulting file).

The resulting file will have correctly named sheets in correct order but they will all be empty (even those not involved in the cloning). If, instead of having a sheet to be duplicated in the template, an empty sheet created with createSheet("...") is used it seems to work, but not if I move the created empty sheet with setSheetOrder before cloning it.
Comment 1 Dominik Stadler 2013-08-23 18:18:25 UTC
This seems to have be fixed in latest trunk, may Bug 50298 was related, but others could be affecting this as well. 

Please reopen if this is still a problem with the latest version of POI, maybe you can then provide a self-contained test-case which does the reading of the values also, it will make comparing the actual with the expected results much easier as it is cumbersome to look at the resulting Excel manually.