Filtering (like Excel)

1 Answer 132 Views
General Discussions SpreadProcessing
Eric
Top achievements
Rank 2
Iron
Iron
Eric asked on 22 Mar 2023, 08:27 PM

I'm trying to programmatically create a spreadsheet from some data.  The spreadsheet I'm modelling has Excel filters at the top.  I've seen many different kinds of filters in the Kendo Document processing APIs, however it doesn't appear that any of them function like the default filter in Excel.  Is there a way to add this to my header cell and let Excel fill it in when the sheet is loaded?

Sample

Sample of what Excel shows when you click the filter button.

Mine (so far)

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 23 Mar 2023, 09:28 AM

Hello Eric,

Yes, this is supported. The following article shows how you can set the filtering: SpreadProcessing - Filtering

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Eric
Top achievements
Rank 2
Iron
Iron
commented on 23 Mar 2023, 01:05 PM

I saw that and could not see that any filter would work except possibly the Values Collection Filter

Values collection filter

This looks the closest, however it appears that I need to add every item in my list to the string items filter.  It also wasn't clear if the Can the dateItems list could be empty?  Is this the one you were thinking of?  If I want a filter that allows the user to click on items and just display those, do I add every item?

Custom filter

This appears to check for a specific value only against a specific operator.

Top Filter

This doesn't appear to work for text items.

Dynamic Filter

None of the filter types were appropriate.

ForeColorFilter and FillColorFilter

Neither of these were appropriate.

 

Dimitar
Telerik team
commented on 23 Mar 2023, 01:43 PM

Hi Eric, 

You can use the AutoFilter  which is set by default and just set the range: 

var worksheet = workbook.Worksheets[0];

worksheet.Filter.FilterRange = new CellRange(0, 0, 10, 10);

Let me know how this works for your case. 

 

 

Eric
Top achievements
Rank 2
Iron
Iron
commented on 23 Mar 2023, 04:00 PM

That's perfect!!!  Thank you so much for the quick response.

Tags
General Discussions SpreadProcessing
Asked by
Eric
Top achievements
Rank 2
Iron
Iron
Answers by
Dimitar
Telerik team
Share this question
or