-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSSF ShiftRows destroy merged cells #601
Comments
Shifting rows, 1 by 1 seems to work. But not when you got to delete row 5 for example and that you got to move up everything from 6-15. I had to write this fix in my code for that:
|
i've struggled also with the insertion of a new line. Let's say i insert a line between lines 9 and 10, i want to keep the same columns merged that i had on line 9. I hope it will help someone, until it is fixed in the next 5-10 years. Seriously, i was surprised that this bug exists in 2017 and still present in the latest version.
|
my deleteRow isn't perfect too. If we have various row heights, you will lose them. I've made a better/longer version which copy the styles & heights so it leave most of my sheet intact... but this ShiftRows is seriously a pain in the ass. |
Affirm, the same behaviour took place in my sheet. This bug was also known at POI, at newest versions https://stackoverflow.com/questions/55980407/apache-poi-shiftrows-corrupts-file-and-deletes-content |
Same for me, ShiftRows destroys merged cells. I've tried to replicate excel-like behavior by reimplementing RowShifter:
|
As a workaround, you can copy and paste the merged regions. You can do that even in different sheets |
我把最新的代码(2022年6月28日)拿下来编译了dll试了下,还是不行,如果我没试错的话。但是我把2.4.1版本的代码找到替换
为老代码就好使了。 |
@serii833 What's your issue here? Can you clarify? I don't see the destroy behavior in your screenshot. I need the exact reproduce steps in order to fix this issue. |
@zzy0471 Can you screenshot your excel to help me understand your issue? |
@tonyqus OK. I have a .xls file like this: I want to insert 'B' between 'A' and 'C', here is my code:
Then I get a file like this: Demo: |
A new PR is created #877. I have tested all your three cases. This fix works very well. |
I would like to report a really old bug that was fixed in POI about 4 years ago. For some reasons, the bug is still present in NPOI.
Shifting up rows destroy merged cells. The content is still there, but the merged dissappeared.
Here's an example of 2 ShiftRows made on my sheet
Anyone can confirm that they have the same problem?
I'm using NPOI 2.5.3
The text was updated successfully, but these errors were encountered: