Hello
How can I filter my worksheet after I set the autfilter columns, and now I want to filter the lines using a specific value.
Thanks
Calin
Hi Calin,
Aspose.Excel doesn’t support to set a specific filter value. You can filter it in your generated file manually.
Thank you Laurence
Is there any chance to support this feature with feature versions?
Calin
Hi Calin,
I will study this feature and add it if possible.
Ok
Thank you
Let me know when if you added this feature.
Calin
@calinberindea,
Aspose.Excel is discontinued and no more available now. A new product Aspose.Cells has replaced it that is much advanced and contains all the latest features available in different versions of MS Excel. You can set an auto filter using a number of options like filter by Color, Date, Number, Text and blanks etc. Here is a sample code that demonstrates this feature by adding an auto filter based on color.
/ Instantiating a Workbook object
// Opening the Excel file through the file stream
Workbook workbook = new Workbook(sourceDir + "ColouredCells.xlsx");
// Instantiating a CellsColor object for foreground color
CellsColor clrForeground = workbook.CreateCellsColor();
clrForeground.Color = Color.Red;
// Instantiating a CellsColor object for background color
CellsColor clrBackground = workbook.CreateCellsColor();
clrBackground.Color = Color.White;
// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
// Call AddFillColorFilter function to apply the filter
worksheet.AutoFilter.AddFillColorFilter(0, BackgroundType.Solid, clrForeground, clrBackground);
// Call refresh function to update the worksheet
worksheet.AutoFilter.Refresh();
// Saving the modified Excel file
workbook.Save(outputDir + "FilteredColouredCells.xlsx");
For more information about data filtering, refer to the following article:
Data Filtering
You can download the latest version of this product here:
Aspose.Cells for .NET (Latest Version)
You can download a working solution here to test the features of this product.