Unable to sort a range of cells alphabetically

I’m trying to sort a range of cells that is 88 rows by 7 columns. I’m sorting alphabetically by column# 7. This is the code that I’m using:

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #4e9072} span.s1 {color: #7e504f} span.s2 {color: #0326cc} span.s3 {color: #000000} span.Apple-tab-span {white-space:pre}

DataSorter sorter = workbook.getDataSorter();

sorter.setOrder1(SortOrder.DESCENDING);

sorter.setKey1(6);

sorter.sort(workbook.getWorksheets().get(4).getCells(),1,14,88,20);


The result does not seem to have any pattern. It is not alphabetical and only a subset of samples have changed from before sorting. What am I missing?

Sorry for the accidental double post!

Hi,


Thanks for your posting and using Aspose.Cells.

Please see this thread, it should help you deal with your sorting problem. It has sample code [in C# and Java], sample excel file and screenshot that explains how to make use of sort feature of Aspose.Cells. Let us know your feedback.