We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Usage of the Excel column filter feature in XlsIO ExcelEngine

Hi,

we are currently using the Syncfusion XlsIO ExcelEngine to generate our excel export files. Now we are interested in using the excel column filter feature for our purposes.
Here a screenshot of the feature:
 

Is there a way to do this with the Syncfusion XlsIO component?

Thanks in advance for your help.

Best regards,
Jochen


5 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team February 19, 2015 07:02 AM UTC

Hi Cubido,

Thank you for using Syncfusion products.

XlsIO supports data filtering functionality. The detailed behavior of the autofilter is explained in following UG link.

UG documentation link:

http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/datafiltering.htm

We have also created a sample which illustrates the autofilter in XlsIO, which is available in the following KB links.

KB link:

1)      https://www.syncfusion.com/kb/1864/how-do-i-add-an-autofilter-to-my-spreadsheet

2)      https://www.syncfusion.com/kb/1939/how-do-i-create-an-autofilter-using-xlsio

Kindly refer to this and let us know if this helps.

Regards,

Dilli babu.




CU cubido February 19, 2015 08:31 AM UTC

Hi Dilli babu,

thanks for your fast reply. It's great to see that I can add this easily to our implementation.
I guess that it's not possible but is there a way to pre-select the filter values for these columns in my code?

Regards,
Jochen



DB Dilli Babu Nandha Gopal Syncfusion Team February 20, 2015 08:15 AM UTC

Hi Jochen,

Thank you for updating us.

Yes, you can pre-select the values of filtered column but there is a limitation in this. Where, you can select only two values as a condition. The below code snippet illustrates the pre-selecting filter values in Autofilters.

Code Snippet:

            sheet.AutoFilters.FilterRange = sheet.Range["A1:A10"];

            IAutoFilter filter = sheet.AutoFilters[0];

           

            filter.FirstCondition.DataType = ExcelFilterDataType.String;

            filter.FirstCondition.String = "test1";

            filter.IsAnd = false;

            filter.SecondCondition.DataType = ExcelFilterDataType.String;

            filter.SecondCondition.String = "test6";

We have shared a simple sample for your reference. Currently we don’t have a support for pre-selecting multiple values. We have logged a feature report for this and have no plans of implementing this now.

The sample can be downloaded from following link.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/118272/Autofilter-1717468444.zip

Please let us know if you have any concerns.

Regards,

Dilli babu.




CU cubido February 24, 2015 09:09 AM UTC

Hi Dilli babu,

thanks for the sample application.
Unfortunately these limitations make the pre-filtering not usable for us.
Nevertheless we can use the default autofilter now and that makes it possible to match the user expectations.

All the best,
Jochen



DB Dilli Babu Nandha Gopal Syncfusion Team February 25, 2015 06:01 AM UTC

Hi Jochen,

 

Thank you for updating us.

Please let us know if you require any further assistance on this.

 

Regards,

Dilli babu.



Loader.
Live Chat Icon For mobile
Up arrow icon