Hi,
Here is our sample code:
Sample code:
Workbook workbook = new Workbook(@“e:\test2\book_base.xlsx”);
AutoFilter filter = workbook.Worksheets[0].AutoFilter;
filter.AddDateFilter(0, DateTimeGroupingType.Day, 2013, 8, 29, 0, 0, 0);
filter.AddDateFilter(0, DateTimeGroupingType.Day, 2013, 8, 30, 0, 0, 0);
filter.AddDateFilter(0, DateTimeGroupingType.Day, 2013, 8, 31, 0, 0, 0);
filter.Refresh();
workbook.Save(@“e:\test2\dest.xlsx”);
And, please find attached the input and output file for your reference. For your information, it is same as per your requirement in your template Excel file “
Book_sample.xlsx”.
"Could you please provide code for Filtering other than dates."
If you need other requirements, kindly provide more details and do attach another Excel file containing your pivot table with your filtered data set, also provide some screen shots taken in MS Excel to highlight it more. We will check it soon.
Thank you.