Aspose.Cells - Sort Data

//Obtain the DataSorter object in the workbook
DataSorter sorter = workbook.getDataSorter();

//Set the first order

//Define the first key.

//Set the second order

//Define the second key

//Create a cells area (range).
CellArea ca = new CellArea();

//Specify the start row index.
ca.StartRow = 1;
//Specify the start column index.
ca.StartColumn = 0;
//Specify the last row index.
ca.EndRow = 9;
//Specify the last column index.
ca.EndColumn = 2;

//Sort data in the specified data range (A2:C10)
sorter.sort(cells, ca);

Download Source Code

For More Examples, visit Aspose Docs

Last edited Aug 11, 2014 at 11:38 AM by shoaibkhan, version 1