"Fossies" - the Fresh Open Source Software Archive

Member "groupoffice-6.4.210-php-71/vendor/phpoffice/phpexcel/Documentation/markdown/Features/Autofilters/02-Setting-an-Autofilter.md" (22 Nov 2018, 911 Bytes) of package /linux/www/groupoffice-6.4.210-php-71.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

PHPExcel AutoFilter Reference

Setting an AutoFilter area on a worksheet

To set an autoFilter on a range of cells.

$objPHPExcel->getActiveSheet()->setAutoFilter('A1:E20');

The first row in an autofilter range will be the heading row, which displays the autoFilter dropdown icons. It is not part of the actual autoFiltered data. All subsequent rows are the autoFiltered data. So an AutoFilter range should always contain the heading row and one or more data rows (one data row is pretty meaningless, but PHPExcel won’t actually stop you specifying a meaningless range: it’s up to you as the developer to avoid such errors.

If you want to set the whole worksheet as an autofilter region

$objPHPExcel->getActiveSheet()->setAutoFilter(
    $objPHPExcel->getActiveSheet()
        ->calculateWorksheetDimension()
);

This enables filtering, but does not actually apply any filters.