Aspose::Cells::AutoFilter class
Contents
[
Hide
]AutoFilter class
Represents autofiltering for the specified worksheet.
class AutoFilter
Methods
Fields
| Field | Description |
|---|---|
| _impl | The implementation object. |
Examples
Aspose::Cells::Startup();
//Creating a file stream containing the Excel file to be opened
//Instantiating a Workbook object
Workbook workbook(u"template.xlsx");
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.GetWorksheets().Get(0);
//Creating AutoFilter by giving the cells range of the heading row
worksheet.GetAutoFilter().SetRange(u"A1:B1");
//Filtering columns with specified values
worksheet.GetAutoFilter().Filter(1, u"Bananas");
//Saving the modified Excel file.
workbook.Save(u"output.xls");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells
- Library Aspose.Cells for C++