Free Support Forum -

Sorting on Multiple Columns Fails when the First Sort Column Contains Texts


When sorting is done on multiple columns and all text cells in first sort column are the same, then the sort result on the second column is incorrect.

If even one of the text cells in the first sort column is different from the rest, then the sort on the second column works as expected.

Here’s the code that we’ve used for this test:

public void SimpleSortTest()


Workbook workbook = new Workbook();

workbook.Open(“c:\testsort.xls”, FileFormatType.Default);

var dataSorter = workbook.DataSorter;

dataSorter.Key1 = 1;

dataSorter.Order1 = SortOrder.Ascending;

dataSorter.Key2 = 2;

dataSorter.Order2 = SortOrder.Descending;

var area = new CellArea


StartRow = 1,

EndRow = 13,

StartColumn = 1,

EndColumn = 2


dataSorter.Sort(workbook.Worksheets[0].Cells, area);

workbook.Save(“c:\testsort.result.xls”, FileFormatType.Default);


See attached.

Stephen Tung

Software Developer

Clarity Systems


Please try this fix.

Works great now, thanks!


Am I able to get access to this fix? It’s currently inaccessible to me


I am sorry but it’s against our company policy to provide the version/fix of the product which is older than one year.

We recommend you to use our latest version/fix e.g v5.3.3:

Thank you.