\PHPExcel_Worksheet_AutoFilter

PHPExcel_Worksheet_AutoFilter

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Summary

Methods
Properties
Constants
__construct()
getParent()
setParent()
getRange()
setRange()
getColumns()
testColumnInRange()
getColumnOffset()
getColumn()
getColumnByOffset()
setColumn()
clearColumn()
shiftColumn()
showHideRows()
__clone()
__toString()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
filterTestInSimpleDataSet()
filterTestInDateGroupSet()
filterTestInCustomDataSet()
filterTestInPeriodDateSet()
dynamicFilterDateRange()
calculateTopTenValue()
$workSheet
$range
$columns
$fromReplace
$toReplace
N/A

Properties

$range

$range : string

Autofilter Range

Type

string

$columns

$columns : array

Autofilter Column Ruleset

Type

array — of PHPExcel_Worksheet_AutoFilter_Column

$fromReplace

$fromReplace : 

Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching

@var array

Type

$toReplace

$toReplace : 

Type

Methods

__construct()

__construct(  $pRange = '', \PHPExcel_Worksheet  $pSheet = null) 

Create a new PHPExcel_Worksheet_AutoFilter

@param string $pRange Cell range (i.e. A1:E10)

Parameters

$pRange
\PHPExcel_Worksheet $pSheet

getParent()

getParent() : \PHPExcel_Worksheet

Get AutoFilter Parent Worksheet

Returns

\PHPExcel_Worksheet

getRange()

getRange() : string

Get AutoFilter Range

Returns

string

setRange()

setRange(  $pRange = '') 

Set AutoFilter Range

@param string $pRange Cell range (i.e. A1:E10)

Parameters

$pRange

Throws

\PHPExcel_Exception

@return PHPExcel_Worksheet_AutoFilter

getColumns()

getColumns() : array

Get all AutoFilter Columns

Throws

\PHPExcel_Exception

Returns

array —

of PHPExcel_Worksheet_AutoFilter_Column

testColumnInRange()

testColumnInRange(string  $column) : integer

Validate that the specified column is in the AutoFilter range

Parameters

string $column

Column name (e.g. A)

Throws

\PHPExcel_Exception

Returns

integer —

The column offset within the autofilter range

getColumnOffset()

getColumnOffset(string  $pColumn) : integer

Get a specified AutoFilter Column Offset within the defined AutoFilter range

Parameters

string $pColumn

Column name (e.g. A)

Throws

\PHPExcel_Exception

Returns

integer —

The offset of the specified column within the autofilter range

getColumn()

getColumn(string  $pColumn) : \PHPExcel_Worksheet_AutoFilter_Column

Get a specified AutoFilter Column

Parameters

string $pColumn

Column name (e.g. A)

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_AutoFilter_Column

getColumnByOffset()

getColumnByOffset(integer  $pColumnOffset) : \PHPExcel_Worksheet_AutoFilter_Column

Get a specified AutoFilter Column by it's offset

Parameters

integer $pColumnOffset

Column offset within range (starting from 0)

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_AutoFilter_Column

setColumn()

setColumn(  $pColumn) 

Set AutoFilter

@param PHPExcel_Worksheet_AutoFilter_Column|string $pColumn A simple string containing a Column ID like 'A' is permitted

Parameters

$pColumn

Throws

\PHPExcel_Exception

@return PHPExcel_Worksheet_AutoFilter

clearColumn()

clearColumn(string  $pColumn) : \PHPExcel_Worksheet_AutoFilter

Clear a specified AutoFilter Column

Parameters

string $pColumn

Column name (e.g. A)

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_AutoFilter

shiftColumn()

shiftColumn(string  $fromColumn = null,   $toColumn = null) 

Shift an AutoFilter Column Rule to a different column

Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range. Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value. Use with caution.

Parameters

string $fromColumn

Column name (e.g. A) @param string $toColumn Column name (e.g. B) @return PHPExcel_Worksheet_AutoFilter

$toColumn

showHideRows()

showHideRows() : \PHPExcel_Worksheet_AutoFilter

Apply the AutoFilter rules to the AutoFilter Range

@throws PHPExcel_Exception

Returns

\PHPExcel_Worksheet_AutoFilter

__clone()

__clone() 

Implement PHP __clone to create a deep clone, not just a shallow copy.

__toString()

__toString() 

toString method replicates previous behavior by returning the range if object is referenced as a property of its parent.

filterTestInSimpleDataSet()

filterTestInSimpleDataSet(  $cellValue, array<mixed,mixed>  $dataSet) 

Test if cell value is in the defined set of values

@param mixed $cellValue

Parameters

$cellValue
array<mixed,mixed> $dataSet

@return boolean

filterTestInDateGroupSet()

filterTestInDateGroupSet(  $cellValue, array<mixed,mixed>  $dataSet) 

Test if cell value is in the defined set of Excel date values

@param mixed $cellValue

Parameters

$cellValue
array<mixed,mixed> $dataSet

@return boolean

filterTestInCustomDataSet()

filterTestInCustomDataSet(  $cellValue, array<mixed,mixed>  $ruleSet) 

Test if cell value is within a set of values defined by a ruleset

@param mixed $cellValue

Parameters

$cellValue
array<mixed,mixed> $ruleSet

@return boolean

filterTestInPeriodDateSet()

filterTestInPeriodDateSet(  $cellValue, array<mixed,mixed>  $monthSet) 

Test if cell date value is matches a set of values defined by a set of months

@param mixed $cellValue

Parameters

$cellValue
array<mixed,mixed> $monthSet

@return boolean

dynamicFilterDateRange()

dynamicFilterDateRange(  $dynamicRuleType,   $filterColumn) 

Convert a dynamic rule daterange to a custom filter range expression for ease of calculation

@param string $dynamicRuleType

Parameters

$dynamicRuleType
$filterColumn

calculateTopTenValue()

calculateTopTenValue(  $columnID,   $startRow,   $endRow,   $ruleType,   $ruleValue) 

Parameters

$columnID
$startRow
$endRow
$ruleType
$ruleValue