[]
        
(Showing Draft Content)

Table Filters

When you have a lot of data to handle, you can create as many tables on a spreadsheet as you want and apply separate filters on columns of each of the table to manage information in an effective manner.

GcExcel .NET provides users with the ability to set table filters while setting up worksheets for ensuring improved data analysis.

When applying filters on tables in worksheets created, you need to first get the table range and then use the AutoFilter method of the IRange interface to filter the table.

Refer to the following example code to set table filters in a worksheet.

//Add Table 
ITable table = worksheet.Tables.Add(worksheet.Range["A1:E5"], true);

//Populate table values
worksheet.Range["A2"].Value = 3;
worksheet.Range["A3"].Value = 4;
worksheet.Range["A4"].Value = 2;
worksheet.Range["A5"].Value = 1;

//Apply table filter
worksheet.Tables[0].Range.AutoFilter(0, ">2");