Sort Data
This article is designed to provide developers with a detailed understanding of how to sort data in a worksheet.
Data sorting is a handy and versatile feature of Microsoft Excel. Generally, sorting is performed on a list, which is defined as a contiguous group of data where the data is displayed in columns. Aspose.Cells allows you to sort worksheet data alphabetically or numerically. It sorts data in the same way as Microsoft Excel does.
You might work with Office Automation for data sorting but Office Automation has its drawbacks. There are several reasons and issues involved: security, stability, scalability/speed, price, and features. In short, there are many reasons to look for a different solution, with the top one being that Microsoft themselves strongly recommends against Office Automation from software solutions.
In this article, we create a console application in Visual Studio.NET, and sort data with a few simple lines of code using the Aspose.Cells API.
Using Aspose.Cells to Sort Data in a Worksheet
- Create a Microsoft Excel file with different data sets or contents.
- Download and install Aspose.Cells:
- Download Aspose.Cells for .NET.
- Install it on your development computer.
- Create a project:
- Start Visual Studio .NET.
- Create a new console application.
- Add a reference to Aspose.Cells in your project:
- Add a reference to …\Program Files\Aspose\ Aspose.Cells for .NET \Bin\Net1.0\Aspose.Cells.dll
- Sort the data in the worksheet:
- Add code to the project.