Setting filter on headers of an Excel sheet via POI

前端 未结 5 840
一个人的身影
一个人的身影 2021-01-30 21:06

I generate a sheet, pretty bog standard headers and columns of data.

I want to turn on the \"Filter\" function for the sheet, so the user can easily sort and filter the

5条回答
  •  春和景丽
    2021-01-30 21:32

    I figured out how to do this with NPOI.
    You add a CT_AutoFilter to the CT_Table.

    I am guessing the it works the same for POI as NPOI.

        cttable.autoFilter = new CT_AutoFilter();
        cttable.autoFilter.@ref = "A1:C5";   // value is data and includes header.
    

提交回复
热议问题