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

Hi,



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

Hi,

Please try this fix.

Works great now, thanks!

Hi,

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

Hi,

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:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry303217.aspx

Thank you.