Free Support Forum - aspose.com
Sort data with four or more keys
Aspose.Cells Product Family
starovoitenko4824
July 2, 2017, 11:03pm
#1
Hi guys,
I use Aspose.Cells for .net. My question is Can I sort data with more than 4 keys?
Now i see only DataSorter class that can sort only with 3 keys.
Thank in advance.
Amjad_Sahi
July 2, 2017, 11:04pm
#2
Hi,
Sure, you may add more keys accordingly for your needs, see the sample code snippet below:
DataSorter
sorter = workbook
.
DataSorter;
sorter
.
AddKey
(
4, Aspose
.
Cells
.
SortOrder
.
Ascending);
sorter
.
AddKey
(
5, Aspose
.
Cells
.
SortOrder
.
Ascending);
sorter
.
AddKey
(
6, Aspose
.
Cells
.
SortOrder
.
Ascending);
sorter
.
AddKey
(
7, Aspose
.
Cells
.
SortOrder
.
Ascending);
sorter
.
Sort
(
workbook
.
Worksheets
[
“Sheet1”]
.
Cells,
cellarea
);
starovoitenko4824
July 2, 2017, 11:04pm
#3
Thank you very much!
Amjad_Sahi
July 2, 2017, 11:04pm
#4
Hi,
Good to know that it works for you.
Feel free to contact us any time if you have any other issue or have some other query, we will be happy to assist you soon.
thank
you.