Problem with DeleteRange and Merged Cells


#1

Hi, I’ve encountered a bug with using DeleteRange() along with meged cells. My designer file, code, and resultant XLS file are here: ftp://ftp13VDTGY:xWrNKm@ftp.directsupply.com (FireFox doesn’t interpret the FTP addy right, use IE or explorer Sad). I’m using version 2.7.5.0.

After inserting my DataTable I sometimes have to delete an unneeded column but not touch some header text up above, so I’m using DeleteRange with ShiftType.Left to nuke the column and its header. This works great except when there are merged cells to the right of the deletion, their contents get shifted over one but the cell doesn’t get deleted, it’s wierd. When I manually do the same operation in Excel it works as expected.

Here’s my DeleteRange() call:


ws.Cells.DeleteRange(2, 0, 5, 0, ShiftType.Left);


#2

Hi David,

Thanks for your report. I fixed this issue and upload the hotfix to http://www.aspose.com/Products/Aspose.Excel/Fixes/Aspose.Excel.zip. You can download it and have a try.


#3

Thanks for the quick response man! I’ll give it a shot tomorrow morning.

-Dave


#4

Cool, the new verison works correctly with the test template, but exhibits the old behavor on my real template about half the time. If I copy the contents of the template to a new excel file and save DeleteRange() will work just fine on the column, but it still screws up on the old file. See GoodTemplate and BadTemplate in ftp://ftp13VDTGY:xWrNKm@ftp.directsupply.com/ with a DeleteRange call of ws.Cells.DeleteRange(4, 1, 9, 1, ShiftType.Left); for each. I’ve uploaded the test page, too.

Hopefully it behaves the same way for you!


#5

Fixed. Please download the hotfix again.


#6
Laurence wrote:
Fixed. Please download the hotfix again.


Perfect! What in the heck was the difference between those two spreadsheets???

#7

Just some cells with white spaces in the bad template. In previous version, the dll doesn't deal with this case. I fixed it in the new hotfix.