|Summary:||cloneSheet(...) takes forever|
|Component:||XSSF||Assignee:||POI Developers List <dev>|
Test Excel file
Description Michael 2015-03-27 17:51:09 UTC
Created attachment 32617 [details] Java code The method cloneSheet(...) of the class XSSFWorkbook takes forever...
Comment 1 Nick Burch 2015-03-30 14:40:27 UTC
Is this for all sheets, or just certain ones? And if it's just certain ones, what kinds of things on the sheet make it slow? Additionally, can you try using a profiler to see where the time is going?
Comment 3 Michael 2015-03-31 13:57:35 UTC
I attached the file I was trying to copy. It has just one small sheet with different styling. When I run my program (trying to copy sheet from one workbook to another), I shut down java process after about 20 minutes of visible inactivity. Few minutes later I had to cold restart my computer because the entire RAM (16Gb) was in use and computer was just "frosen". Hope this will help.
Comment 4 Nick Burch 2015-03-31 14:01:13 UTC
Your attached code will never work. Your problem is you keep cloning a sheet onto the end of a workbook, then keep looping until you have seen all sheets which you neever will as you keep adding new ones Additionally, you cannot clone a sheet onto another workbook, which is what I think you're trying to do.
Comment 5 Michael 2015-03-31 14:04:17 UTC
Is any convenient way to copy a sheet from one workbook to another? Or I have to do it manually, row-by-row, ...?