Document Solutions for Excel, Java Edition | Document Solutions
Features / Table / Table Filters
In This Topic
    Table Filters
    In This Topic

    While dealing with bulk data in spreadsheets, you can create as many tables on a worksheet as you want and apply separate filters on columns of each of the table to manage essential information in an effective manner.

    Using DsExcel Java, you can apply table filters while setting up worksheets for ensuring improved and quick data analysis.

    To apply 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.

    In order to set table filters in a worksheet, refer to the following example code.

    Java
    Copy Code
    //Add table
    ITable table = worksheet.getTables().add(worksheet.getRange("A1:E5"), true);
    System.out.println(table);
            
    //Assign values to the range 
    worksheet.getRange("A2").setValue(3);
    worksheet.getRange("A3").setValue(4);
    worksheet.getRange("A4").setValue(2);
    worksheet.getRange("A5").setValue(1);
            
    //Apply table filter 
    worksheet.getTables().get(0).getRange().autoFilter(0, ">2");