Copying worksheets or workbooks does not preserve table sorting

Using the Copy method for either the Worksheet or Workbook classes does not preserve sorting from the source.

using Aspose.Cells;

License license = new();
license.SetLicense("Aspose.Total.NET.lic");

// Open a workbook which has one sheet with a table which has a basic descending sort on one column
Workbook wb = new("test.xlsx");
var source = wb.Worksheets[0];
// Make a copy of the first sheet
var copy = wb.Worksheets.Add("copy");
copy.Copy(source);

wb.Save("test_with_copy_sheet.xlsx"); // no sort on the new sheet

// Now let's try with a copied workbook
Workbook sourceWb = new("test.xlsx");
Workbook destWb = new();
destWb.Copy(sourceWb);

destWb.Save("test_new_workbook_copy.xlsx", SaveFormat.Xlsx); // no sort again

@ayounger,

Could you please zip and attach your input Excel file. We will check your issue soon.

test.zip (7.1 KB)

@ayounger
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-53104
1 Like

The issues you have found earlier (filed as CELLSNET-53104) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

1 Like