Set AutoFilter Range

@param    string        $pRange        Cell range (i.e. A1:E10)
@throws    PHPExcel_Exception
@return PHPExcel_Worksheet_AutoFilter
320762
public function setRange($pRange = '')
    {
        // Uppercase coordinate
        $cellAddress = explode('!', strtoupper($pRange));
        if (count($cellAddress) > 1) {
            list($worksheet, $pRange) = $cellAddress;
        }

        if (strpos($pRange, ':') !== false) {
            $this->range = $pRange;
        } elseif (empty($pRange)) {
            $this->range = '';
        } else {
            throw new PHPExcel_Exception('Autofilter must be set on a range of cells.');
        }

        if (empty($pRange)) {
            //    Discard all column rules
            $this->columns = array();
        } else {
            //    Discard any column rules that are no longer valid within this range
            list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
            foreach ($this->columns as $key => $value) {
                $colIndex = PHPExcel_Cell::columnIndexFromString($key);
                if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
                    unset($this->columns[$key]);
                }
            }
        }

        return $this;
    }
874852
public function setProtection(PHPExcel_Worksheet_Protection $pValue)
    {
        $this->_protection = $pValue;
        $this->_dirty = true;

        return $this;
    }
788287
public function setValue($pValue = NULL)
	{
		if (!self::getValueBinder()->bindValue($this, $pValue)) {
			throw new PHPExcel_Exception("Value could not be bound to cell.");
		}
		return $this;
	}
1299611
public function setSelectedCells($pCoordinate = 'A1')
    {
        // Uppercase coordinate
        $pCoordinate = strtoupper($pCoordinate);

        // Convert 'A' to 'A:A'
        $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate);

        // Convert '1' to '1:1'
        $pCoordinate = preg_replace('/^([0-9]+)$/', '${1}:${1}', $pCoordinate);

        // Convert 'A:C' to 'A1:C1048576'
        $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate);

        // Convert '1:3' to 'A1:XFD3'
        $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate);

        if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
            list($first, ) = PHPExcel_Cell::splitRange($pCoordinate);
            $this->activeCell = $first[0];
        } else {
            $this->activeCell = $pCoordinate;
        }
        $this->selectedCells = $pCoordinate;
        return $this;
    }
372953
protected function adjustForExistingOnlyRange()
    {
        if ($this->onlyExistingCells) {
            while ((!$this->subject->cellExistsByColumnAndRow($this->startColumn, $this->rowIndex)) &&
                ($this->startColumn <= $this->endColumn)) {
                ++$this->startColumn;
            }
            if ($this->startColumn > $this->endColumn) {
                throw new PHPExcel_Exception('No cells exist within the specified range');
            }
            while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) &&
                ($this->endColumn >= $this->startColumn)) {
                --$this->endColumn;
            }
            if ($this->endColumn < $this->startColumn) {
                throw new PHPExcel_Exception('No cells exist within the specified range');
            }
        }
    }
687264
public function setColumn($pColumn)
    {
        if ((is_string($pColumn)) && (!empty($pColumn))) {
            $column = $pColumn;
        } elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
            $column = $pColumn->getColumnIndex();
        } else {
            throw new PHPExcel_Exception("Column is not within the autofilter range.");
        }
        $this->testColumnInRange($column);

        if (is_string($pColumn)) {
            $this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
        } elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
            $pColumn->setParent($this);
            $this->columns[$column] = $pColumn;
        }
        ksort($this->columns);

        return $this;
    }
382677
public function filterRange($range)
    {
        if (is_int($range)) {
            $level = $range;
            $depth = 0;
        } else {
            reset($range);
            $level = key($range);
            $depth = current($range);
        }

        if (1 === $level) {
            $nodeList = $this->xp->query('/descendant-or-self::*[ name() = "ul" and count( ancestor-or-self::ul ) >= '.$level.'  ]')->item(0);
        } else {
            $nodeList = $this->xp->query('/descendant-or-self::*[ name() = "ul" and count( ancestor-or-self::ul ) >= '.$level.' and ( descendant-or-self::*[ contains(@class, "open") or contains(@class, "active") ] or ancestor-or-self::*[ contains(@class, "open")  or contains(@class, "active") ] ) ]')->item(0);
        }

        if (!$nodeList) {
            return false;
        }

        if (false === $depth) {
            return $nodeList;
        }

        $depthNodelist = $this->xp->query('./descendant::*[ name() = "ul" and count( ancestor-or-self::ul ) > '.($level + $depth).' ]', $nodeList);

        foreach ($depthNodelist as $node) {
            $node->parentNode->removeChild($node);
        }

        if ($nodeList) {
            return $nodeList;
        } else {
            return false;
        }
    }
434299
public function setZoomScale($pValue = 100) {
		// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
		// but it is apparently still able to handle any scale >= 1
		if (($pValue >= 1) || is_null($pValue)) {
			$this->_zoomScale = $pValue;
		} else {
			throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
		}
		return $this;
	}
322771
public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null)
    {
        if (!isset($this->parent)) {
            throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
        }

        $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);

        return $this->notifyCacheController();
    }
848334
public function setFilterRange($attribute, $min, $max, $exclude = false)
    {
        $this->sphinx->SetFilterRange($attribute, $min, $max, $exclude);
    }
1269412
function SetFilterRange ( $attribute, $min, $max, $exclude=false )
    {
        assert ( is_string($attribute) );
        assert ( is_numeric($min) );
        assert ( is_numeric($max) );
        assert ( $min<=$max );

        $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max );
    }
622710
public function setAutoFilter($pValue)
    {
        if (is_string($pValue)) {
            $this->_autoFilter->setRange($pValue);
        } elseif(is_object($pValue) && ($pValue instanceof PHPExcel_Worksheet_AutoFilter)) {
            $this->_autoFilter = $pValue;
        }
        return $this;
    }
1124189
public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE)
    {
        // Uppercase coordinate
        $pCell = strtoupper($pCell);

        if ($pCell != '') {
        	if ($pBreak == PHPExcel_Worksheet::BREAK_NONE) {
        		if (isset($this->_breaks[$pCell])) {
	            	unset($this->_breaks[$pCell]);
        		}
        	} else {
	            $this->_breaks[$pCell] = $pBreak;
	        }
        } else {
            throw new PHPExcel_Exception('No cell coordinate specified.');
        }

        return $this;
    }
934894
public function filter($table)
    {
        foreach ($table->getRows() as $key => $row) {
            //instead search must handle
            // - negative search with -piwik
            // - exact match with ""
            // see (?!pattern) 	A subexpression that performs a negative lookahead search, which matches the search string at any point where a string not matching pattern begins.
            $value = $row->getColumn($this->columnToFilter);
            if ($value === false) {
                $value = $row->getMetadata($this->columnToFilter);
            }
            if (!self::match($this->patternToSearchQuoted, $value, $this->invertedMatch)) {
                $table->deleteRow($key);
            }
        }
    }
270782
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
    {
        if (!in_array($pFilterType, self::$filterTypes)) {
            throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
        }

        $this->filterType = $pFilterType;

        return $this;
    }
1286255
public function applyFilterRange(Filter\FilterRange $filter)
	{
		$conditions = $filter->getCondition();
		$c = $this->checkAliases($filter->getColumn());

		$value_from = $conditions[$filter->getColumn()]['from'];
		$value_to = $conditions[$filter->getColumn()]['to'];

		if ($value_from) {
			$p = $this->getPlaceholder();
			$this->data_source->andWhere("$c >= :$p")->setParameter($p, $value_from);
		}

		if ($value_to) {
			$p = $this->getPlaceholder();
			$this->data_source->andWhere("$c <= :$p")->setParameter($p, $value_to);
		}
	}
638055
public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = NULL)
	{
		if (!isset($this->_parent)) {
			throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
		}

		$this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);

		return $this->notifyCacheController();
	}