ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Worksheet Class Reference
+ Inheritance diagram for PHPExcel_Worksheet:
+ Collaboration diagram for PHPExcel_Worksheet:

Public Member Functions

 __construct (PHPExcel $pParent=null, $pTitle= 'Worksheet')
 Create a new worksheet.
 getCellCollection ($pSorted=true)
 Get collection of cells.
 sortCellCollection ()
 Sort collection of cells.
 getRowDimensions ()
 Get collection of row dimensions.
 getDefaultRowDimension ()
 Get default row dimension.
 getColumnDimensions ()
 Get collection of column dimensions.
 getDefaultColumnDimension ()
 Get default column dimension.
 getDrawingCollection ()
 Get collection of drawings.
 refreshColumnDimensions ()
 Refresh column dimensions.
 refreshRowDimensions ()
 Refresh row dimensions.
 calculateWorksheetDimension ()
 Calculate worksheet dimension.
 calculateColumnWidths ($calculateMergeCells=false)
 Calculate widths for auto-size columns.
 getParent ()
 Get parent.
 rebindParent (PHPExcel $parent)
 Re-bind parent.
 getTitle ()
 Get title.
 setTitle ($pValue= 'Worksheet')
 Set title.
 getPageSetup ()
 Get page setup.
 setPageSetup (PHPExcel_Worksheet_PageSetup $pValue)
 Set page setup.
 getPageMargins ()
 Get page margins.
 setPageMargins (PHPExcel_Worksheet_PageMargins $pValue)
 Set page margins.
 getHeaderFooter ()
 Get page header/footer.
 setHeaderFooter (PHPExcel_Worksheet_HeaderFooter $pValue)
 Set page header/footer.
 getSheetView ()
 Get sheet view.
 setSheetView (PHPExcel_Worksheet_SheetView $pValue)
 Set sheet view.
 getProtection ()
 Get Protection.
 setProtection (PHPExcel_Worksheet_Protection $pValue)
 Set Protection.
 getHighestColumn ()
 Get highest worksheet column.
 getHighestRow ()
 Get highest worksheet row.
 setCellValue ($pCoordinate= 'A1', $pValue=null)
 Set a cell value.
 setCellValueByColumnAndRow ($pColumn=0, $pRow=0, $pValue=null)
 Set a cell value by using numeric cell coordinates.
 setCellValueExplicit ($pCoordinate= 'A1', $pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
 Set a cell value.
 setCellValueExplicitByColumnAndRow ($pColumn=0, $pRow=0, $pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
 Set a cell value by using numeric cell coordinates.
 getCell ($pCoordinate= 'A1')
 Get cell at a specific coordinate.
 getCellByColumnAndRow ($pColumn=0, $pRow=0)
 Get cell at a specific coordinate by using numeric cell coordinates.
 cellExists ($pCoordinate= 'A1')
 Cell at a specific coordinate exists?
 cellExistsByColumnAndRow ($pColumn=0, $pRow=0)
 Cell at a specific coordinate by using numeric cell coordinates exists?
 getRowDimension ($pRow=0)
 Get row dimension at a specific row.
 getColumnDimension ($pColumn= 'A')
 Get column dimension at a specific column.
 getColumnDimensionByColumn ($pColumn=0)
 Get column dimension at a specific column by using numeric cell coordinates.
 getStyles ()
 Get styles.
 getDefaultStyle ()
 Get default style of workbork.
 setDefaultStyle (PHPExcel_Style $value)
 Set default style - should only be used by PHPExcel_IReader implementations!
 getStyle ($pCellCoordinate= 'A1')
 Get style for cell.
 getConditionalStyles ($pCoordinate= 'A1')
 Get conditional styles for a cell.
 conditionalStylesExists ($pCoordinate= 'A1')
 Do conditional styles exist for this cell?
 removeConditionalStyles ($pCoordinate= 'A1')
 Removes conditional styles for a cell.
 getConditionalStylesCollection ()
 Get collection of conditional styles.
 setConditionalStyles ($pCoordinate= 'A1', $pValue)
 Set conditional styles.
 getStyleByColumnAndRow ($pColumn=0, $pRow=0)
 Get style for cell by using numeric cell coordinates.
 setSharedStyle (PHPExcel_Style $pSharedCellStyle=null, $pRange= '')
 Set shared cell style to a range of cells.
 duplicateStyle (PHPExcel_Style $pCellStyle=null, $pRange= '')
 Duplicate cell style to a range of cells.
 duplicateStyleArray ($pStyles=null, $pRange= '', $pAdvanced=true)
 Duplicate cell style array to a range of cells.
 setBreak ($pCell= 'A1', $pBreak=PHPExcel_Worksheet::BREAK_NONE)
 Set break on a cell.
 setBreakByColumnAndRow ($pColumn=0, $pRow=0, $pBreak=PHPExcel_Worksheet::BREAK_NONE)
 Set break on a cell by using numeric cell coordinates.
 getBreaks ()
 Get breaks.
 mergeCells ($pRange= 'A1:A1')
 Set merge on a cell range.
 mergeCellsByColumnAndRow ($pColumn1=0, $pRow1=0, $pColumn2=0, $pRow2=0)
 Set merge on a cell range by using numeric cell coordinates.
 unmergeCells ($pRange= 'A1:A1')
 Remove merge on a cell range.
 unmergeCellsByColumnAndRow ($pColumn1=0, $pRow1=0, $pColumn2=0, $pRow2=0)
 Remove merge on a cell range by using numeric cell coordinates.
 getMergeCells ()
 Get merge cells.
 protectCells ($pRange= 'A1', $pPassword= '', $pAlreadyHashed=false)
 Set protection on a cell range.
 protectCellsByColumnAndRow ($pColumn1=0, $pRow1=0, $pColumn2=0, $pRow2=0, $pPassword= '', $pAlreadyHashed=false)
 Set protection on a cell range by using numeric cell coordinates.
 unprotectCells ($pRange= 'A1')
 Remove protection on a cell range.
 unprotectCellsByColumnAndRow ($pColumn1=0, $pRow1=0, $pColumn2=0, $pRow2=0, $pPassword= '', $pAlreadyHashed=false)
 Remove protection on a cell range by using numeric cell coordinates.
 getProtectedCells ()
 Get protected cells.
 getAutoFilter ()
 Get Autofilter Range.
 setAutoFilter ($pRange= '')
 Set Autofilter Range.
 setAutoFilterByColumnAndRow ($pColumn1=0, $pRow1=0, $pColumn2=0, $pRow2=0)
 Set Autofilter Range by using numeric cell coordinates.
 getFreezePane ()
 Get Freeze Pane.
 freezePane ($pCell= '')
 Freeze Pane.
 freezePaneByColumnAndRow ($pColumn=0, $pRow=0)
 Freeze Pane by using numeric cell coordinates.
 unfreezePane ()
 Unfreeze Pane.
 insertNewRowBefore ($pBefore=1, $pNumRows=1)
 Insert a new row, updating all possible related data.
 insertNewColumnBefore ($pBefore= 'A', $pNumCols=1)
 Insert a new column, updating all possible related data.
 insertNewColumnBeforeByIndex ($pBefore=0, $pNumCols=1)
 Insert a new column, updating all possible related data.
 removeRow ($pRow=1, $pNumRows=1)
 Delete a row, updating all possible related data.
 removeColumn ($pColumn= 'A', $pNumCols=1)
 Remove a column, updating all possible related data.
 removeColumnByIndex ($pColumn=0, $pNumCols=1)
 Remove a column, updating all possible related data.
 getShowGridlines ()
 Show gridlines?
 setShowGridlines ($pValue=false)
 Set show gridlines.
 getPrintGridlines ()
 Print gridlines?
 setPrintGridlines ($pValue=false)
 Set print gridlines.
 getShowSummaryBelow ()
 Show summary below? (Row/Column outlining)
 setShowSummaryBelow ($pValue=true)
 Set show summary below.
 getShowSummaryRight ()
 Show summary right? (Row/Column outlining)
 setShowSummaryRight ($pValue=true)
 Set show summary right.
 getComments ()
 Get comments.
 getComment ($pCellCoordinate= 'A1')
 Get comment for cell.
 getCommentByColumnAndRow ($pColumn=0, $pRow=0)
 Get comment for cell by using numeric cell coordinates.
 getSelectedCell ()
 Get selected cell.
 getXActiveCell ()
 Temporary method used by style supervisor.
 getXSelectedCells ()
 Temporary method used by style supervisor.
 setSelectedCell ($pCell= '')
 Selected cell.
 setXSelectedCells ($pCoordinate= 'A1:A1')
 Temporary method used by style supervisor.
 setSelectedCellByColumnAndRow ($pColumn=0, $pRow=0)
 Selected cell by using numeric cell coordinates.
 getRightToLeft ()
 Get right-to-left.
 setRightToLeft ($value=false)
 Set right-to-left.
 fromArray ($source=null, $nullValue=null, $pCell= 'A1')
 Fill worksheet from values in array.
 toArray ($nullValue=null, $calculateFormulas=true)
 Create array from worksheet.
 getRowIterator ()
 Get row iterator.
 garbageCollect ()
 Run PHPExcel garabage collector.
 getHashCode ()
 Get hash code.
 getHashIndex ()
 Get hash index.
 setHashIndex ($value)
 Set hash index.
 getHyperlink ($pCellCoordinate= 'A1')
 Get hyperlink.
 setHyperlink ($pCellCoordinate= 'A1', PHPExcel_Cell_Hyperlink $pHyperlink=null)
 Set hyperlnk.
 hyperlinkExists ($pCoordinate= 'A1')
 Hyperlink at a specific coordinate exists?
 getHyperlinkCollection ()
 Get collection of hyperlinks.
 getDataValidation ($pCellCoordinate= 'A1')
 Get data validation.
 setDataValidation ($pCellCoordinate= 'A1', PHPExcel_Cell_DataValidation $pDataValidation=null)
 Set data validation.
 dataValidationExists ($pCoordinate= 'A1')
 Data validation at a specific coordinate exists?
 getDataValidationCollection ()
 Get collection of data validations.
 copy ()
 Copy worksheet (!= clone!)
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.

Static Public Member Functions

static extractSheetTitle ($pRange, $returnRange=false)
 Extract worksheet title from range.

Data Fields

const BREAK_NONE = 0
const BREAK_ROW = 1
const BREAK_COLUMN = 2

Private Attributes

 $_parent
 $_cellCollection = array()
 $_rowDimensions = array()
 $_defaultRowDimension = null
 $_columnDimensions = array()
 $_defaultColumnDimension = null
 $_drawingCollection = null
 $_title
 $_pageSetup
 $_pageMargins
 $_headerFooter
 $_sheetView
 $_protection
 $_styles = array()
 $_conditionalStylesCollection = array()
 $_cellCollectionIsSorted = false
 $_breaks = array()
 $_mergeCells = array()
 $_protectedCells = array()
 $_autoFilter = ''
 $_freezePane = ''
 $_showGridlines = true
 $_printGridlines = false
 $_showSummaryBelow = true
 $_showSummaryRight = true
 $_comments = array()
 $_selectedCell = 'A1'
 $_xActiveCell = 'A1'
 $_xSelectedCells = 'A1:A1'
 $_cachedHighestColumn = null
 $_cachedHighestRow = null
 $_rightToLeft = false
 $_hyperlinkCollection = array()
 $_dataValidationCollection = array()
 $_hashIndex

Detailed Description

Definition at line 117 of file Worksheet.php.

Constructor & Destructor Documentation

PHPExcel_Worksheet::__construct ( PHPExcel  $pParent = null,
  $pTitle = 'Worksheet' 
)

Create a new worksheet.

Parameters
PHPExcel$pParent
string$pTitle

Definition at line 368 of file Worksheet.php.

References setTitle().

{
// Set parent and title
$this->_parent = $pParent;
$this->setTitle($pTitle);
// Set page setup
$this->_pageSetup = new PHPExcel_Worksheet_PageSetup();
// Set page margins
$this->_pageMargins = new PHPExcel_Worksheet_PageMargins();
// Set page header/footer
$this->_headerFooter = new PHPExcel_Worksheet_HeaderFooter();
// Set sheet view
$this->_sheetView = new PHPExcel_Worksheet_SheetView();
// Drawing collection
$this->_drawingCollection = new ArrayObject();
// Protection
$this->_protection = new PHPExcel_Worksheet_Protection();
// Gridlines
$this->_showGridlines = true;
$this->_printGridlines = false;
// Outline summary
$this->_showSummaryBelow = true;
$this->_showSummaryRight = true;
// Default row dimension
$this->_defaultRowDimension = new PHPExcel_Worksheet_RowDimension(null);
// Default column dimension
$this->_defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(null);
}

+ Here is the call graph for this function:

Member Function Documentation

PHPExcel_Worksheet::__clone ( )

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

Definition at line 2367 of file Worksheet.php.

References $key.

{
foreach ($this as $key => $val) {
if ($key == '_parent') {
continue;
}
if (is_object($val) || (is_array($val))) {
$this->{$key} = unserialize(serialize($val));
}
}
}
PHPExcel_Worksheet::calculateColumnWidths (   $calculateMergeCells = false)

Calculate widths for auto-size columns.

Parameters
boolean$calculateMergeCellsCalculate merge cell width
Returns
PHPExcel_Worksheet;

Definition at line 564 of file Worksheet.php.

References PHPExcel_Shared_Font\calculateColumnWidth(), getCellCollection(), getColumnDimension(), getColumnDimensions(), getDefaultColumnDimension(), getMergeCells(), and getParent().

{
$autoSizes = array();
foreach ($this->getColumnDimensions() as $colDimension) {
if ($colDimension->getAutoSize()) {
$autoSizes[$colDimension->getColumnIndex()] = -1;
}
}
foreach ($this->getCellCollection() as $cell) {
if (isset($autoSizes[$cell->getColumn()])) {
$cellValue = $cell->getCalculatedValue();
foreach ($this->getMergeCells() as $cells) {
if ($cell->isInRange($cells) && !$calculateMergeCells) {
$cellValue = ''; // do not calculate merge cells
}
}
$autoSizes[$cell->getColumn()] = max(
(float)$autoSizes[$cell->getColumn()],
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSize(),
false,
$cellValue,
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation()
)
);
}
}
foreach ($autoSizes as $columnIndex => $width) {
if ($width == -1) $width = $this->getDefaultColumnDimension()->getWidth();
$this->getColumnDimension($columnIndex)->setWidth($width);
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::calculateWorksheetDimension ( )

Calculate worksheet dimension.

Returns
string String containing the dimension of this worksheet

Definition at line 552 of file Worksheet.php.

References getHighestColumn(), and getHighestRow().

Referenced by toArray().

{
// Return
return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::cellExists (   $pCoordinate = 'A1')

Cell at a specific coordinate exists?

Parameters
string$pCoordinateCoordinate of the cell
Exceptions
Exception
Returns
boolean

Definition at line 1018 of file Worksheet.php.

References PHPExcel_Calculation\CALCULATION_REGEXP_CELLREF, PHPExcel_Cell\coordinateFromString(), elseif(), extractSheetTitle(), getHashCode(), getParent(), getTitle(), and PHPExcel_NamedRange\resolveRange().

Referenced by cellExistsByColumnAndRow().

{
// Worksheet reference?
if (strpos($pCoordinate, '!') !== false) {
$worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
return $this->getParent()->getSheetByName($worksheetReference[0])->cellExists($worksheetReference[1]);
}
// Named range?
if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
(preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches))) {
$namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
if (!is_null($namedRange)) {
$pCoordinate = $namedRange->getRange();
if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
if (!$namedRange->getLocalOnly()) {
return $namedRange->getWorksheet()->cellExists($pCoordinate);
} else {
throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
}
}
}
}
// Uppercase coordinate
$pCoordinate = strtoupper($pCoordinate);
if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
throw new Exception('Cell coordinate can not be a range of cells.');
} elseif (strpos($pCoordinate,'$') !== false) {
throw new Exception('Cell coordinate must not be absolute.');
} else {
// Coordinates
$aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
// Cell exists?
return isset($this->_cellCollection[$pCoordinate]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::cellExistsByColumnAndRow (   $pColumn = 0,
  $pRow = 0 
)

Cell at a specific coordinate by using numeric cell coordinates exists?

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
Returns
boolean

Definition at line 1065 of file Worksheet.php.

References cellExists(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by toArray().

{
return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::conditionalStylesExists (   $pCoordinate = 'A1')

Do conditional styles exist for this cell?

Parameters
string$pCoordinate
Returns
boolean

Definition at line 1194 of file Worksheet.php.

{
if (isset($this->_conditionalStylesCollection[$pCoordinate])) {
return true;
}
return false;
}
PHPExcel_Worksheet::copy ( )

Copy worksheet (!= clone!)

Returns
PHPExcel_Worksheet

Definition at line 2358 of file Worksheet.php.

{
$copied = clone $this;
return $copied;
}
PHPExcel_Worksheet::dataValidationExists (   $pCoordinate = 'A1')

Data validation at a specific coordinate exists?

Parameters
string$pCellCoordinate
Returns
boolean

Definition at line 2338 of file Worksheet.php.

{
return isset($this->_dataValidationCollection[$pCoordinate]);
}
PHPExcel_Worksheet::duplicateStyle ( PHPExcel_Style  $pCellStyle = null,
  $pRange = '' 
)

Duplicate cell style to a range of cells.

Please note that this will overwrite existing cell styles for cells in range!

Parameters
PHPExcel_Style$pCellStyleCell style to duplicate
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1276 of file Worksheet.php.

References $_parent, $row, PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), getCell(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by setSharedStyle().

{
// make sure we have a real style and not supervisor
$style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle;
// Add the style to the workbook if necessary
$workbook = $this->_parent;
if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
// there is already such cell Xf in our collection
$xfIndex = $existingStyle->getIndex();
} else {
// we don't have such a cell Xf, need to add
$workbook->addCellXf($pCellStyle);
$xfIndex = $pCellStyle->getIndex();
}
// Uppercase coordinate
$pRange = strtoupper($pRange);
// Is it a cell range or a single cell?
$rangeA = '';
$rangeB = '';
if (strpos($pRange, ':') === false) {
$rangeA = $pRange;
$rangeB = $pRange;
} else {
list($rangeA, $rangeB) = explode(':', $pRange);
}
// Calculate range outer borders
$rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
// Translate column into index
$rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
$rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
// Make sure we can loop upwards on rows and columns
if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
$tmp = $rangeStart;
$rangeStart = $rangeEnd;
$rangeEnd = $tmp;
}
// Loop trough cells and apply styles
for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
$this->getCell(PHPExcel_Cell::stringFromColumnIndex($col) . $row)->setXfIndex($xfIndex);
}
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::duplicateStyleArray (   $pStyles = null,
  $pRange = '',
  $pAdvanced = true 
)

Duplicate cell style array to a range of cells.

Please note that this will overwrite existing cell styles for cells in range, if they are in the styles array. For example, if you decide to set a range of cells to font bold, only include font bold in the styles array.

Deprecated:
Parameters
array$pStylesArray containing style information
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
boolean$pAdvancedAdvanced mode for setting borders.
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1344 of file Worksheet.php.

References getStyle().

{
$this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced);
return $this;
}

+ Here is the call graph for this function:

static PHPExcel_Worksheet::extractSheetTitle (   $pRange,
  $returnRange = false 
)
static

Extract worksheet title from range.

Example: extractSheetTitle('test!A1') ==> 'A1' Example: extractSheetTitle('test!A1', true) ==> array('test', 'A1');

Parameters
string$pRangeRange to extract title from
bool$returnRangeReturn range? (see example)
Returns
mixed

Definition at line 2211 of file Worksheet.php.

Referenced by cellExists(), PHPExcel_Calculation\extractCellRange(), PHPExcel_Calculation\extractNamedRange(), getCell(), and PHPExcel_Reader_Excel2007\load().

{
// Sheet title included?
if (strpos($pRange, '!') === false) {
return '';
}
// Position of separator exclamation mark
$sep = strrpos($pRange, '!');
// Extract sheet title
$reference[0] = substr($pRange, 0, $sep);
$reference[1] = substr($pRange, $sep + 1);
// Strip possible enclosing single quotes
if (strpos($reference[0], '\'') === 0) {
$reference[0] = substr($reference[0], 1);
}
if (strrpos($reference[0], '\'') === strlen($reference[0]) - 1) {
$reference[0] = substr($reference[0], 0, strlen($reference[0]) - 1);
}
if ($returnRange) {
return $reference;
} else {
return $reference[1];
}
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::freezePane (   $pCell = '')

Freeze Pane.

Parameters
string$pCellCell (i.e. A1)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1638 of file Worksheet.php.

Referenced by freezePaneByColumnAndRow(), and unfreezePane().

{
// Uppercase coordinate
$pCell = strtoupper($pCell);
if (strpos($pCell,':') === false && strpos($pCell,',') === false) {
$this->_freezePane = $pCell;
} else {
throw new Exception('Freeze pane can not be set on a range of cells.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::freezePaneByColumnAndRow (   $pColumn = 0,
  $pRow = 0 
)

Freeze Pane by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1659 of file Worksheet.php.

References freezePane(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::fromArray (   $source = null,
  $nullValue = null,
  $pCell = 'A1' 
)

Fill worksheet from values in array.

Parameters
array$sourceSource array
mixed$nullValueValue treated as "null"
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 2025 of file Worksheet.php.

References PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), setCellValue(), and PHPExcel_Cell\stringFromColumnIndex().

{
if (is_array($source)) {
// start coordinate
list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($pCell);
$startColumn = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
// Loop trough $source
$currentRow = $startRow - 1;
$rowData = null;
foreach ($source as $rowData) {
++$currentRow;
$rowCount = count($rowData);
for ($i = 0; $i < $rowCount; ++$i) {
if ($rowData[$i] != $nullValue) {
// Set cell value
$this->setCellValue(
PHPExcel_Cell::stringFromColumnIndex($i + $startColumn) . $currentRow, $rowData[$i]
);
}
}
}
} else {
throw new Exception("Parameter \$source should be an array.");
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::garbageCollect ( )

Run PHPExcel garabage collector.

Returns
PHPExcel_Worksheet

Definition at line 2118 of file Worksheet.php.

References getDrawingCollection().

Referenced by toArray().

{
// Build a reference table from images
$imageCoordinates = array();
$iterator = $this->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
$imageCoordinates[$iterator->current()->getCoordinates()] = true;
$iterator->next();
}
// Find cells that can be cleaned
foreach ($this->_cellCollection as $coordinate => $cell) {
// Can be cleaned?
$canBeCleaned = false;
// Empty value?
if (is_null($cell->getValue()) || (!is_object($cell->getValue()) && $cell->getValue() === '' && !$cell->hasHyperlink())) {
// default style ?
if ($cell->getXfIndex() == 0) {
$canBeCleaned = true;
}
}
// Referenced in image?
if (isset($imageCoordinates[$coordinate]) && $imageCoordinates[$coordinate] === true) {
$canBeCleaned = false;
}
// Clean?
if ($canBeCleaned) {
unset($this->_cellCollection[$coordinate]);
}
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getAutoFilter ( )

Get Autofilter Range.

Returns
string

Definition at line 1577 of file Worksheet.php.

References $_autoFilter.

{
}
PHPExcel_Worksheet::getBreaks ( )

Get breaks.

Returns
array[]

Definition at line 1391 of file Worksheet.php.

References $_breaks.

{
}
PHPExcel_Worksheet::getCell (   $pCoordinate = 'A1')

Get cell at a specific coordinate.

Parameters
string$pCoordinateCoordinate of the cell
Exceptions
Exception
Returns
PHPExcel_Cell Cell that was found

Definition at line 937 of file Worksheet.php.

References PHPExcel_Calculation\CALCULATION_REGEXP_CELLREF, PHPExcel_Cell\coordinateFromString(), elseif(), extractSheetTitle(), getHashCode(), getParent(), getTitle(), PHPExcel_NamedRange\resolveRange(), and PHPExcel_Cell_DataType\TYPE_NULL.

Referenced by duplicateStyle(), getDataValidation(), getHyperlink(), setCellValue(), setCellValueExplicit(), setDataValidation(), and setHyperlink().

{
// Check cell collection
if (isset($this->_cellCollection[$pCoordinate])) {
return $this->_cellCollection[$pCoordinate];
}
// Worksheet reference?
if (strpos($pCoordinate, '!') !== false) {
$worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
return $this->getParent()->getSheetByName($worksheetReference[0])->getCell($worksheetReference[1]);
}
// Named range?
if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
(preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches))) {
$namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
if (!is_null($namedRange)) {
$pCoordinate = $namedRange->getRange();
if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
if (!$namedRange->getLocalOnly()) {
return $namedRange->getWorksheet()->getCell($pCoordinate);
} else {
throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
}
}
}
}
// Uppercase coordinate
$pCoordinate = strtoupper($pCoordinate);
if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
throw new Exception('Cell coordinate can not be a range of cells.');
} elseif (strpos($pCoordinate,'$') !== false) {
throw new Exception('Cell coordinate must not be absolute.');
} else {
// Coordinates
$aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
$this->_cellCollection[$pCoordinate] = new PHPExcel_Cell($aCoordinates[0], $aCoordinates[1], null, PHPExcel_Cell_DataType::TYPE_NULL, $this);
$this->_cellCollectionIsSorted = false;
$this->_cachedHighestColumn = null;
$this->_cachedHighestRow = null;
return $this->_cellCollection[$pCoordinate];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getCellByColumnAndRow (   $pColumn = 0,
  $pRow = 0 
)

Get cell at a specific coordinate by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
Returns
PHPExcel_Cell Cell that was found

Definition at line 994 of file Worksheet.php.

References PHPExcel_Cell\stringFromColumnIndex(), and PHPExcel_Cell_DataType\TYPE_NULL.

Referenced by toArray().

{
$coordinate = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow;
if (!isset($this->_cellCollection[$coordinate])) {
$columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn);
$this->_cellCollection[$coordinate] = new PHPExcel_Cell($columnLetter, $pRow, null, PHPExcel_Cell_DataType::TYPE_NULL, $this);
$this->_cellCollectionIsSorted = false;
$this->_cachedHighestColumn = null;
$this->_cachedHighestRow = null;
}
return $this->_cellCollection[$coordinate];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getCellCollection (   $pSorted = true)

Get collection of cells.

Parameters
boolean$pSortedAlso sort the cell collection?
Returns
PHPExcel_Cell[]

Definition at line 413 of file Worksheet.php.

References $_cellCollection, and sortCellCollection().

Referenced by PHPExcel\addExternalSheet(), and calculateColumnWidths().

{
if ($pSorted) {
// Re-order cell collection
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getColumnDimension (   $pColumn = 'A')

Get column dimension at a specific column.

Parameters
string$pColumnString index of the column
Returns
PHPExcel_Worksheet_ColumnDimension

Definition at line 1095 of file Worksheet.php.

Referenced by calculateColumnWidths(), and getColumnDimensionByColumn().

{
// Uppercase coordinate
$pColumn = strtoupper($pColumn);
// Fetch dimensions
if (!isset($this->_columnDimensions[$pColumn])) {
$this->_columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn);
$this->_cachedHighestColumn = null;
}
return $this->_columnDimensions[$pColumn];
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getColumnDimensionByColumn (   $pColumn = 0)

Get column dimension at a specific column by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
Returns
PHPExcel_Worksheet_ColumnDimension

Definition at line 1115 of file Worksheet.php.

References getColumnDimension(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

PHPExcel_Worksheet::getColumnDimensions ( )

Get collection of column dimensions.

Returns
PHPExcel_Worksheet_ColumnDimension[]

Definition at line 484 of file Worksheet.php.

References $_columnDimensions.

Referenced by calculateColumnWidths(), and refreshColumnDimensions().

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getComment (   $pCellCoordinate = 'A1')

Get comment for cell.

Parameters
string$pCellCoordinateCell coordinate to get comment for
Returns
PHPExcel_Comment
Exceptions
Exception

Definition at line 1876 of file Worksheet.php.

Referenced by getCommentByColumnAndRow().

{
// Uppercase coordinate
$pCellCoordinate = strtoupper($pCellCoordinate);
if (strpos($pCellCoordinate,':') !== false || strpos($pCellCoordinate,',') !== false) {
throw new Exception('Cell coordinate string can not be a range of cells.');
} else if (strpos($pCellCoordinate,'$') !== false) {
throw new Exception('Cell coordinate string must not be absolute.');
} else if ($pCellCoordinate == '') {
throw new Exception('Cell coordinate can not be zero-length string.');
} else {
// Check if we already have a comment for this cell.
// If not, create a new comment.
if (isset($this->_comments[$pCellCoordinate])) {
return $this->_comments[$pCellCoordinate];
} else {
$newComment = new PHPExcel_Comment();
$this->_comments[$pCellCoordinate] = $newComment;
return $newComment;
}
}
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getCommentByColumnAndRow (   $pColumn = 0,
  $pRow = 0 
)

Get comment for cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Returns
PHPExcel_Comment

Definition at line 1907 of file Worksheet.php.

References getComment(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::getComments ( )

Get comments.

Returns
PHPExcel_Comment[]

Definition at line 1864 of file Worksheet.php.

References $_comments.

{
}
PHPExcel_Worksheet::getConditionalStyles (   $pCoordinate = 'A1')

Get conditional styles for a cell.

Parameters
string$pCoordinate
Returns
PHPExcel_Style_Conditional[]

Definition at line 1180 of file Worksheet.php.

{
if (!isset($this->_conditionalStylesCollection[$pCoordinate])) {
$this->_conditionalStylesCollection[$pCoordinate] = array();
}
return $this->_conditionalStylesCollection[$pCoordinate];
}
PHPExcel_Worksheet::getConditionalStylesCollection ( )

Get collection of conditional styles.

Returns
array

Definition at line 1219 of file Worksheet.php.

References $_conditionalStylesCollection.

PHPExcel_Worksheet::getDataValidation (   $pCellCoordinate = 'A1')

Get data validation.

Parameters
string$pCellCoordinateCell coordinate to get data validation for

Definition at line 2301 of file Worksheet.php.

References getCell().

{
// return data validation if we already have one
if (isset($this->_dataValidationCollection[$pCellCoordinate])) {
return $this->_dataValidationCollection[$pCellCoordinate];
}
// else create data validation
$cell = $this->getCell($pCellCoordinate);
$this->_dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation($cell);
return $this->_dataValidationCollection[$pCellCoordinate];
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::getDataValidationCollection ( )

Get collection of data validations.

Returns
PHPExcel_Cell_DataValidation[]

Definition at line 2348 of file Worksheet.php.

References $_dataValidationCollection.

PHPExcel_Worksheet::getDefaultColumnDimension ( )

Get default column dimension.

Returns
PHPExcel_Worksheet_ColumnDimension

Definition at line 494 of file Worksheet.php.

References $_defaultColumnDimension.

Referenced by calculateColumnWidths().

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getDefaultRowDimension ( )

Get default row dimension.

Returns
PHPExcel_Worksheet_RowDimension

Definition at line 474 of file Worksheet.php.

References $_defaultRowDimension.

PHPExcel_Worksheet::getDefaultStyle ( )

Get default style of workbork.

Deprecated:
Returns
PHPExcel_Style
Exceptions
Exception

Definition at line 1137 of file Worksheet.php.

{
return $this->_parent->getDefaultStyle();
}
PHPExcel_Worksheet::getDrawingCollection ( )

Get collection of drawings.

Returns
PHPExcel_Worksheet_BaseDrawing[]

Definition at line 504 of file Worksheet.php.

References $_drawingCollection.

Referenced by PHPExcel_Writer_HTML\_writeImageTagInCell(), and garbageCollect().

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getFreezePane ( )

Get Freeze Pane.

Returns
string

Definition at line 1626 of file Worksheet.php.

References $_freezePane.

{
}
PHPExcel_Worksheet::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 2160 of file Worksheet.php.

Referenced by cellExists(), getCell(), and PHPExcel\getIndex().

{
return md5(
$this->_title
. $this->_autoFilter
. ($this->_protection->isProtectionEnabled() ? 't' : 'f')
//. $this->calculateWorksheetDimension()
. __CLASS__
);
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getHashIndex ( )

Get hash index.

Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.

Returns
string Hash index

Implements PHPExcel_IComparable.

Definition at line 2185 of file Worksheet.php.

References $_hashIndex.

{
}
PHPExcel_Worksheet::getHeaderFooter ( )

Get page header/footer.

Returns
PHPExcel_Worksheet_HeaderFooter

Definition at line 737 of file Worksheet.php.

References $_headerFooter.

{
}
PHPExcel_Worksheet::getHighestColumn ( )

Get highest worksheet column.

Returns
string Highest column name

Definition at line 803 of file Worksheet.php.

References $_cachedHighestColumn, PHPExcel_Cell\columnIndexFromString(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by calculateWorksheetDimension().

{
// Cached?
if (!is_null($this->_cachedHighestColumn)) {
}
// Highest column
$highestColumn = -1;
// Loop trough cells
foreach ($this->_cellCollection as $cell) {
if ($highestColumn < PHPExcel_Cell::columnIndexFromString($cell->getColumn())) {
$highestColumn = PHPExcel_Cell::columnIndexFromString($cell->getColumn());
}
}
// Loop trough column dimensions
foreach ($this->_columnDimensions as $dimension) {
if ($highestColumn < PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex())) {
$highestColumn = PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex());
}
}
// Return & cache
if ($highestColumn < 0) {
$this->_cachedHighestColumn = 'A';
} else {
$this->_cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getHighestRow ( )

Get highest worksheet row.

Returns
int Highest row number

Definition at line 842 of file Worksheet.php.

References $_cachedHighestRow.

Referenced by calculateWorksheetDimension().

{
// Cached?
if (!is_null($this->_cachedHighestRow)) {
}
// Highest row
$highestRow = 1;
// Loop trough cells
foreach ($this->_cellCollection as $cell) {
if ($cell->getRow() > $highestRow) {
$highestRow = $cell->getRow();
}
}
// Loop trough row dimensions
foreach ($this->_rowDimensions as $dimension) {
if ($highestRow < $dimension->getRowIndex()) {
$highestRow = $dimension->getRowIndex();
}
}
// Cache
$this->_cachedHighestRow = $highestRow;
// Return
return $highestRow;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getHyperlink (   $pCellCoordinate = 'A1')

Get hyperlink.

Parameters
string$pCellCoordinateCell coordinate to get hyperlink for

Definition at line 2244 of file Worksheet.php.

References getCell().

{
// return hyperlink if we already have one
if (isset($this->_hyperlinkCollection[$pCellCoordinate])) {
return $this->_hyperlinkCollection[$pCellCoordinate];
}
// else create hyperlink
$cell = $this->getCell($pCellCoordinate);
$this->_hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink($cell);
return $this->_hyperlinkCollection[$pCellCoordinate];
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::getHyperlinkCollection ( )

Get collection of hyperlinks.

Returns
PHPExcel_Cell_Hyperlink[]

Definition at line 2291 of file Worksheet.php.

References $_hyperlinkCollection.

PHPExcel_Worksheet::getMergeCells ( )

Get merge cells.

Returns
array[]

Definition at line 1479 of file Worksheet.php.

References $_mergeCells.

Referenced by PHPExcel_Writer_HTML\_generateRow(), and calculateColumnWidths().

{
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getPageMargins ( )

Get page margins.

Returns
PHPExcel_Worksheet_PageMargins

Definition at line 715 of file Worksheet.php.

References $_pageMargins.

{
}
PHPExcel_Worksheet::getPageSetup ( )

Get page setup.

Returns
PHPExcel_Worksheet_PageSetup

Definition at line 693 of file Worksheet.php.

References $_pageSetup.

{
}
PHPExcel_Worksheet::getParent ( )

Get parent.

Returns
PHPExcel

Definition at line 607 of file Worksheet.php.

References $_parent.

Referenced by PHPExcel_Writer_HTML\_generateRow(), PHPExcel\addExternalSheet(), calculateColumnWidths(), cellExists(), getCell(), PHPExcel_NamedRange\resolveRange(), and setTitle().

{
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getPrintGridlines ( )

Print gridlines?

Returns
boolean

Definition at line 1804 of file Worksheet.php.

References $_printGridlines.

PHPExcel_Worksheet::getProtectedCells ( )

Get protected cells.

Returns
array[]

Definition at line 1567 of file Worksheet.php.

References $_protectedCells.

PHPExcel_Worksheet::getProtection ( )

Get Protection.

Returns
PHPExcel_Worksheet_Protection

Definition at line 781 of file Worksheet.php.

References $_protection.

{
}
PHPExcel_Worksheet::getRightToLeft ( )

Get right-to-left.

Returns
boolean

Definition at line 2002 of file Worksheet.php.

References $_rightToLeft.

{
}
PHPExcel_Worksheet::getRowDimension (   $pRow = 0)

Get row dimension at a specific row.

Parameters
int$pRowNumeric index of the row
Returns
PHPExcel_Worksheet_RowDimension

Definition at line 1076 of file Worksheet.php.

{
// Found
$found = null;
// Get row dimension
if (!isset($this->_rowDimensions[$pRow])) {
$this->_rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow);
$this->_cachedHighestRow = null;
}
return $this->_rowDimensions[$pRow];
}
PHPExcel_Worksheet::getRowDimensions ( )

Get collection of row dimensions.

Returns
PHPExcel_Worksheet_RowDimension[]

Definition at line 464 of file Worksheet.php.

References $_rowDimensions.

Referenced by refreshRowDimensions().

{
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getRowIterator ( )

Get row iterator.

Returns
PHPExcel_Worksheet_RowIterator

Definition at line 2109 of file Worksheet.php.

{
return new PHPExcel_Worksheet_RowIterator($this);
}
PHPExcel_Worksheet::getSelectedCell ( )

Get selected cell.

Returns
string

Definition at line 1917 of file Worksheet.php.

References $_selectedCell.

{
}
PHPExcel_Worksheet::getSheetView ( )

Get sheet view.

Returns
PHPExcel_Worksheet_HeaderFooter

Definition at line 759 of file Worksheet.php.

References $_sheetView.

{
}
PHPExcel_Worksheet::getShowGridlines ( )

Show gridlines?

Returns
boolean

Definition at line 1784 of file Worksheet.php.

References $_showGridlines.

{
}
PHPExcel_Worksheet::getShowSummaryBelow ( )

Show summary below? (Row/Column outlining)

Returns
boolean

Definition at line 1824 of file Worksheet.php.

References $_showSummaryBelow.

PHPExcel_Worksheet::getShowSummaryRight ( )

Show summary right? (Row/Column outlining)

Returns
boolean

Definition at line 1844 of file Worksheet.php.

References $_showSummaryRight.

PHPExcel_Worksheet::getStyle (   $pCellCoordinate = 'A1')

Get style for cell.

Parameters
string$pCellCoordinateCell coordinate to get style for
Returns
PHPExcel_Style
Exceptions
Exception

Definition at line 1163 of file Worksheet.php.

References setXSelectedCells().

Referenced by duplicateStyleArray(), and getStyleByColumnAndRow().

{
// set this sheet as active
$this->_parent->setActiveSheetIndex($this->_parent->getIndex($this));
// set cell coordinate as active
$this->setXSelectedCells($pCellCoordinate);
return $this->_parent->getCellXfSupervisor();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getStyleByColumnAndRow (   $pColumn = 0,
  $pRow = 0 
)

Get style for cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Returns
PHPExcel_Style

Definition at line 1244 of file Worksheet.php.

References getStyle(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::getStyles ( )

Get styles.

Returns
PHPExcel_Style[]

Definition at line 1125 of file Worksheet.php.

References $_styles.

{
}
PHPExcel_Worksheet::getTitle ( )

Get title.

Returns
string

Definition at line 636 of file Worksheet.php.

References $_title.

Referenced by PHPExcel\addExternalSheet(), cellExists(), getCell(), and setTitle().

{
return $this->_title;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::getXActiveCell ( )

Temporary method used by style supervisor.

Will be removed

Returns
string

Definition at line 1927 of file Worksheet.php.

References $_xActiveCell.

{
}
PHPExcel_Worksheet::getXSelectedCells ( )

Temporary method used by style supervisor.

Will be removed

Returns
string

Definition at line 1937 of file Worksheet.php.

References $_xSelectedCells.

PHPExcel_Worksheet::hyperlinkExists (   $pCoordinate = 'A1')

Hyperlink at a specific coordinate exists?

Parameters
string$pCellCoordinate
Returns
boolean

Definition at line 2281 of file Worksheet.php.

{
return isset($this->_hyperlinkCollection[$pCoordinate]);
}
PHPExcel_Worksheet::insertNewColumnBefore (   $pBefore = 'A',
  $pNumCols = 1 
)

Insert a new column, updating all possible related data.

Parameters
int$pBeforeInsert before this one
int$pNumColsNumber of columns to insert
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1700 of file Worksheet.php.

References PHPExcel_ReferenceHelper\getInstance().

Referenced by insertNewColumnBeforeByIndex().

{
if (!is_numeric($pBefore)) {
$objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
$objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
} else {
throw new Exception("Column references should not be numeric.");
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::insertNewColumnBeforeByIndex (   $pBefore = 0,
  $pNumCols = 1 
)

Insert a new column, updating all possible related data.

Parameters
int$pBeforeInsert before this one (numeric column coordinate of the cell)
int$pNumColsNumber of columns to insert
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1718 of file Worksheet.php.

References insertNewColumnBefore(), and PHPExcel_Cell\stringFromColumnIndex().

{
if ($pBefore >= 0) {
return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols);
} else {
throw new Exception("Columns can only be inserted before at least column A (0).");
}
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::insertNewRowBefore (   $pBefore = 1,
  $pNumRows = 1 
)

Insert a new row, updating all possible related data.

Parameters
int$pBeforeInsert before this one
int$pNumRowsNumber of rows to insert
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1682 of file Worksheet.php.

References PHPExcel_ReferenceHelper\getInstance().

{
if ($pBefore >= 1) {
$objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
$objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
} else {
throw new Exception("Rows can only be inserted before at least row 1.");
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::mergeCells (   $pRange = 'A1:A1')

Set merge on a cell range.

Parameters
string$pRangeCell range (e.g. A1:E1)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1403 of file Worksheet.php.

Referenced by mergeCellsByColumnAndRow().

:A1')
{
// Uppercase coordinate
$pRange = strtoupper($pRange);
if (strpos($pRange,':') !== false) {
$this->_mergeCells[$pRange] = $pRange;
} else {
throw new Exception('Merge must be set on a range of cells.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::mergeCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 0,
  $pColumn2 = 0,
  $pRow2 = 0 
)

Set merge on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1427 of file Worksheet.php.

References mergeCells(), and PHPExcel_Cell\stringFromColumnIndex().

{
$cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
return $this->mergeCells($cellRange);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::protectCells (   $pRange = 'A1',
  $pPassword = '',
  $pAlreadyHashed = false 
)

Set protection on a cell range.

Parameters
string$pRangeCell (e.g. A1) or cell range (e.g. A1:E1)
string$pPasswordPassword to unlock the protection
boolean$pAlreadyHashedIf the password has already been hashed, set this to true
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1493 of file Worksheet.php.

References PHPExcel_Shared_PasswordHasher\hashPassword().

Referenced by protectCellsByColumnAndRow().

{
// Uppercase coordinate
$pRange = strtoupper($pRange);
if (!$pAlreadyHashed) {
}
$this->_protectedCells[$pRange] = $pPassword;
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::protectCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 0,
  $pColumn2 = 0,
  $pRow2 = 0,
  $pPassword = '',
  $pAlreadyHashed = false 
)

Set protection on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
string$pPasswordPassword to unlock the protection
boolean$pAlreadyHashedIf the password has already been hashed, set this to true
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1518 of file Worksheet.php.

References protectCells(), and PHPExcel_Cell\stringFromColumnIndex().

{
$cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::rebindParent ( PHPExcel  $parent)

Re-bind parent.

Parameters
PHPExcel$parent
Returns
PHPExcel_Worksheet

Definition at line 617 of file Worksheet.php.

References PHPExcel\addNamedRange().

Referenced by PHPExcel\addExternalSheet().

{
$namedRanges = $this->_parent->getNamedRanges();
foreach ($namedRanges as $namedRange) {
$parent->addNamedRange($namedRange);
}
$this->_parent->removeSheetByIndex(
$this->_parent->getIndex($this)
);
$this->_parent = $parent;
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::refreshColumnDimensions ( )

Refresh column dimensions.

Returns
PHPExcel_Worksheet

Definition at line 514 of file Worksheet.php.

References getColumnDimensions().

{
$currentColumnDimensions = $this->getColumnDimensions();
$newColumnDimensions = array();
foreach ($currentColumnDimensions as $objColumnDimension) {
$newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
}
$this->_columnDimensions = $newColumnDimensions;
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::refreshRowDimensions ( )

Refresh row dimensions.

Returns
PHPExcel_Worksheet

Definition at line 533 of file Worksheet.php.

References getRowDimensions().

{
$currentRowDimensions = $this->getRowDimensions();
$newRowDimensions = array();
foreach ($currentRowDimensions as $objRowDimension) {
$newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
}
$this->_rowDimensions = $newRowDimensions;
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::removeColumn (   $pColumn = 'A',
  $pNumCols = 1 
)

Remove a column, updating all possible related data.

Parameters
int$pColumnRemove starting with this one
int$pNumColsNumber of columns to remove
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1752 of file Worksheet.php.

References PHPExcel_Cell\columnIndexFromString(), PHPExcel_ReferenceHelper\getInstance(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by removeColumnByIndex().

{
if (!is_numeric($pColumn)) {
$objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
$objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this);
} else {
throw new Exception("Column references should not be numeric.");
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::removeColumnByIndex (   $pColumn = 0,
  $pNumCols = 1 
)

Remove a column, updating all possible related data.

Parameters
int$pColumnRemove starting with this one (numeric column coordinate of the cell)
int$pNumColsNumber of columns to remove
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1771 of file Worksheet.php.

References removeColumn(), and PHPExcel_Cell\stringFromColumnIndex().

{
if ($pColumn >= 0) {
return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols);
} else {
throw new Exception("Columns can only be inserted before at least column A (0).");
}
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::removeConditionalStyles (   $pCoordinate = 'A1')

Removes conditional styles for a cell.

Parameters
string$pCoordinate
Returns
PHPExcel_Worksheet

Definition at line 1208 of file Worksheet.php.

{
unset($this->_conditionalStylesCollection[$pCoordinate]);
return $this;
}
PHPExcel_Worksheet::removeRow (   $pRow = 1,
  $pNumRows = 1 
)

Delete a row, updating all possible related data.

Parameters
int$pRowRemove starting with this one
int$pNumRowsNumber of rows to remove
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1734 of file Worksheet.php.

References PHPExcel_ReferenceHelper\getInstance().

{
if ($pRow >= 1) {
$objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
$objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this);
} else {
throw new Exception("Rows to be deleted should at least start from row 1.");
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setAutoFilter (   $pRange = '')

Set Autofilter Range.

Parameters
string$pRangeCell range (i.e. A1:E10)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1589 of file Worksheet.php.

Referenced by setAutoFilterByColumnAndRow().

{
// Uppercase coordinate
$pRange = strtoupper($pRange);
if (strpos($pRange,':') !== false) {
$this->_autoFilter = $pRange;
} else {
throw new Exception('Autofilter must be set on a range of cells.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::setAutoFilterByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 0,
  $pColumn2 = 0,
  $pRow2 = 0 
)

Set Autofilter Range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the second cell
int$pRow2Numeric row coordinate of the second cell
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1612 of file Worksheet.php.

References setAutoFilter(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->setAutoFilter(
. ':' .
);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setBreak (   $pCell = 'A1',
  $pBreak = PHPExcel_Worksheet::BREAK_NONE 
)

Set break on a cell.

Parameters
string$pCellCell coordinate (e.g. A1)
int$pBreakBreak type (type of PHPExcel_Worksheet::BREAK_*)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1358 of file Worksheet.php.

Referenced by setBreakByColumnAndRow().

{
// Uppercase coordinate
$pCell = strtoupper($pCell);
if ($pCell != '') {
$this->_breaks[$pCell] = $pBreak;
} else {
throw new Exception('No cell coordinate specified.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::setBreakByColumnAndRow (   $pColumn = 0,
  $pRow = 0,
  $pBreak = PHPExcel_Worksheet::BREAK_NONE 
)

Set break on a cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
int$pBreakBreak type (type of PHPExcel_Worksheet::BREAK_*)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1381 of file Worksheet.php.

References setBreak(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setCellValue (   $pCoordinate = 'A1',
  $pValue = null 
)

Set a cell value.

Parameters
string$pCoordinateCoordinate of the cell
mixed$pValueValue of the cell
Returns
PHPExcel_Worksheet

Definition at line 880 of file Worksheet.php.

References getCell().

Referenced by fromArray(), and setCellValueByColumnAndRow().

{
// Set value
$this->getCell($pCoordinate)->setValue($pValue);
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::setCellValueByColumnAndRow (   $pColumn = 0,
  $pRow = 0,
  $pValue = null 
)

Set a cell value by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
mixed$pValueValue of the cell
Returns
PHPExcel_Worksheet

Definition at line 896 of file Worksheet.php.

References setCellValue(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->setCellValue(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pValue);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setCellValueExplicit (   $pCoordinate = 'A1',
  $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING 
)

Set a cell value.

Parameters
string$pCoordinateCoordinate of the cell
mixed$pValueValue of the cell
string$pDataTypeExplicit data type
Returns
PHPExcel_Worksheet

Definition at line 909 of file Worksheet.php.

References getCell().

Referenced by setCellValueExplicitByColumnAndRow().

{
// Set value
$this->getCell($pCoordinate)->setValueExplicit($pValue, $pDataType);
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::setCellValueExplicitByColumnAndRow (   $pColumn = 0,
  $pRow = 0,
  $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING 
)

Set a cell value by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
mixed$pValueValue of the cell
string$pDataTypeExplicit data type
Returns
PHPExcel_Worksheet

Definition at line 925 of file Worksheet.php.

References setCellValueExplicit(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->setCellValueExplicit(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pValue, $pDataType);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setConditionalStyles (   $pCoordinate = 'A1',
  $pValue 
)

Set conditional styles.

Parameters
$pCoordinatestring E.g. 'A1'
$pValuePHPExcel_Style_Conditional[]
Returns
PHPExcel_Worksheet

Definition at line 1231 of file Worksheet.php.

{
$this->_conditionalStylesCollection[$pCoordinate] = $pValue;
return $this;
}
PHPExcel_Worksheet::setDataValidation (   $pCellCoordinate = 'A1',
PHPExcel_Cell_DataValidation  $pDataValidation = null 
)

Set data validation.

Parameters
string$pCellCoordinateCell coordinate to insert data validation
PHPExcel_Cell_DataValidation$pDataValidation
Returns
PHPExcel_Worksheet

Definition at line 2321 of file Worksheet.php.

References getCell().

{
if ($pDataValidation === null) {
unset($this->_dataValidationCollection[$pCellCoordinate]);
} else {
$this->_dataValidationCollection[$pCellCoordinate] = $pDataValidation;
$pDataValidation->setParent($this->getCell($pCellCoordinate));
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setDefaultStyle ( PHPExcel_Style  $value)

Set default style - should only be used by PHPExcel_IReader implementations!

Deprecated:
Parameters
PHPExcel_Style$value
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1150 of file Worksheet.php.

{
$this->_parent->setDefaultStyle($value);
return $this;
}
PHPExcel_Worksheet::setHashIndex (   $value)

Set hash index.

Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.

Parameters
string$valueHash index

Implements PHPExcel_IComparable.

Definition at line 2197 of file Worksheet.php.

{
$this->_hashIndex = $value;
}
PHPExcel_Worksheet::setHeaderFooter ( PHPExcel_Worksheet_HeaderFooter  $pValue)

Set page header/footer.

Parameters
PHPExcel_Worksheet_HeaderFooter$pValue
Returns
PHPExcel_Worksheet

Definition at line 748 of file Worksheet.php.

{
$this->_headerFooter = $pValue;
return $this;
}
PHPExcel_Worksheet::setHyperlink (   $pCellCoordinate = 'A1',
PHPExcel_Cell_Hyperlink  $pHyperlink = null 
)

Set hyperlnk.

Parameters
string$pCellCoordinateCell coordinate to insert hyperlink
PHPExcel_Cell_Hyperlink$pHyperlink
Returns
PHPExcel_Worksheet

Definition at line 2264 of file Worksheet.php.

References getCell().

{
if ($pHyperlink === null) {
unset($this->_hyperlinkCollection[$pCellCoordinate]);
} else {
$this->_hyperlinkCollection[$pCellCoordinate] = $pHyperlink;
$pHyperlink->setParent($this->getCell($pCellCoordinate));
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setPageMargins ( PHPExcel_Worksheet_PageMargins  $pValue)

Set page margins.

Parameters
PHPExcel_Worksheet_PageMargins$pValue
Returns
PHPExcel_Worksheet

Definition at line 726 of file Worksheet.php.

{
$this->_pageMargins = $pValue;
return $this;
}
PHPExcel_Worksheet::setPageSetup ( PHPExcel_Worksheet_PageSetup  $pValue)

Set page setup.

Parameters
PHPExcel_Worksheet_PageSetup$pValue
Returns
PHPExcel_Worksheet

Definition at line 704 of file Worksheet.php.

{
$this->_pageSetup = $pValue;
return $this;
}
PHPExcel_Worksheet::setPrintGridlines (   $pValue = false)

Set print gridlines.

Parameters
boolean$pValuePrint gridlines (true/false)
Returns
PHPExcel_Worksheet

Definition at line 1814 of file Worksheet.php.

{
$this->_printGridlines = $pValue;
return $this;
}
PHPExcel_Worksheet::setProtection ( PHPExcel_Worksheet_Protection  $pValue)

Set Protection.

Parameters
PHPExcel_Worksheet_Protection$pValue
Returns
PHPExcel_Worksheet

Definition at line 792 of file Worksheet.php.

{
$this->_protection = $pValue;
return $this;
}
PHPExcel_Worksheet::setRightToLeft (   $value = false)

Set right-to-left.

Parameters
boolean$valueRight-to-left true/false
Returns
PHPExcel_Worksheet

Definition at line 2012 of file Worksheet.php.

{
$this->_rightToLeft = $value;
return $this;
}
PHPExcel_Worksheet::setSelectedCell (   $pCell = '')

Selected cell.

Parameters
string$pCellCell (i.e. A1)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1949 of file Worksheet.php.

Referenced by setSelectedCellByColumnAndRow().

{
// Uppercase coordinate
$pCell = strtoupper($pCell);
if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
$this->_selectedCell = $pCell;
} else {
throw new Exception('Selected cell can not be set on a range of cells.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::setSelectedCellByColumnAndRow (   $pColumn = 0,
  $pRow = 0 
)

Selected cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1992 of file Worksheet.php.

References setSelectedCell(), and PHPExcel_Cell\stringFromColumnIndex().

{
return $this->setSelectedCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setSharedStyle ( PHPExcel_Style  $pSharedCellStyle = null,
  $pRange = '' 
)

Set shared cell style to a range of cells.

Please note that this will overwrite existing cell styles for cells in range!

Deprecated:
Parameters
PHPExcel_Style$pSharedCellStyleCell style to share
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1260 of file Worksheet.php.

References duplicateStyle().

{
$this->duplicateStyle($pSharedCellStyle, $pRange);
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::setSheetView ( PHPExcel_Worksheet_SheetView  $pValue)

Set sheet view.

Parameters
PHPExcel_Worksheet_SheetView$pValue
Returns
PHPExcel_Worksheet

Definition at line 770 of file Worksheet.php.

{
$this->_sheetView = $pValue;
return $this;
}
PHPExcel_Worksheet::setShowGridlines (   $pValue = false)

Set show gridlines.

Parameters
boolean$pValueShow gridlines (true/false)
Returns
PHPExcel_Worksheet

Definition at line 1794 of file Worksheet.php.

{
$this->_showGridlines = $pValue;
return $this;
}
PHPExcel_Worksheet::setShowSummaryBelow (   $pValue = true)

Set show summary below.

Parameters
boolean$pValueShow summary below (true/false)
Returns
PHPExcel_Worksheet

Definition at line 1834 of file Worksheet.php.

{
$this->_showSummaryBelow = $pValue;
return $this;
}
PHPExcel_Worksheet::setShowSummaryRight (   $pValue = true)

Set show summary right.

Parameters
boolean$pValueShow summary right (true/false)
Returns
PHPExcel_Worksheet

Definition at line 1854 of file Worksheet.php.

{
$this->_showSummaryRight = $pValue;
return $this;
}
PHPExcel_Worksheet::setTitle (   $pValue = 'Worksheet')

Set title.

Parameters
string$pValueString containing the dimension of this worksheet
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 648 of file Worksheet.php.

References PHPExcel_Shared_String\CountCharacters(), PHPExcel_ReferenceHelper\getInstance(), getParent(), and getTitle().

Referenced by __construct().

{
// Is this a 'rename' or not?
if ($this->getTitle() == $pValue) {
return;
}
// Maximum 31 characters allowed for sheet title
throw new Exception('Maximum 31 characters allowed in sheet title.');
}
// Old title
$oldTitle = $this->getTitle();
// Is there already such sheet name?
if ($this->getParent()->getSheetByName($pValue)) {
// Use name, but append with lowest possible integer
$i = 1;
while ($this->getParent()->getSheetByName($pValue . ' ' . $i)) {
++$i;
}
$altTitle = $pValue . ' ' . $i;
$this->setTitle($altTitle);
return;
}
// Set title
$this->_title = $pValue;
// New title
$newTitle = $this->getTitle();
PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->getParent(), $oldTitle, $newTitle);
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::setXSelectedCells (   $pCoordinate = 'A1:A1')

Temporary method used by style supervisor.

Will be removed

Parameters
string$pCellCell (i.e. A1)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1969 of file Worksheet.php.

References PHPExcel_Cell\splitRange().

Referenced by getStyle().

:A1')
{
// Uppercase coordinate
$pCoordinate = strtoupper($pCoordinate);
if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
list($first, ) = PHPExcel_Cell::splitRange($pCoordinate);
$this->_xActiveCell = $first[0];
} else {
$this->_xActiveCell = $pCoordinate;
}
$this->_xSelectedCells = $pCoordinate;
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::sortCellCollection ( )

Sort collection of cells.

Returns
PHPExcel_Worksheet

Definition at line 428 of file Worksheet.php.

References $key, and PHPExcel_Cell\columnIndexFromString().

Referenced by getCellCollection().

{
if (!$this->_cellCollectionIsSorted) {
// Re-order cell collection
// uasort($this->_cellCollection, array('PHPExcel_Cell', 'compareCells')); <-- slow
$indexed = array();
foreach (array_keys($this->_cellCollection) as $index) {
$rowNum = $this->_cellCollection[$index]->getRow();
$colNum = PHPExcel_Cell::columnIndexFromString($this->_cellCollection[$index]->getColumn());
// Columns are limited to ZZZ (18278), so 20000 is plenty to assure no conflicts
$key = $rowNum * 20000 + $colNum;
$indexed[$key] = $index; // &$this->_cellCollection[$index];
}
ksort($indexed);
// Rebuild cellCollection from the sorted index
$newCellCollection = array();
foreach ($indexed as $index) {
$newCellCollection[$index] = $this->_cellCollection[$index];
}
$this->_cellCollection = $newCellCollection;
$this->_cellCollectionIsSorted = true;
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Worksheet::toArray (   $nullValue = null,
  $calculateFormulas = true 
)

Create array from worksheet.

Parameters
mixed$nullValueValue treated as "null"
boolean$calculateFormulasShould formulas be calculated?
Returns
array

Definition at line 2060 of file Worksheet.php.

References $row, calculateWorksheetDimension(), cellExistsByColumnAndRow(), PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), garbageCollect(), getCellByColumnAndRow(), and PHPExcel_Style_NumberFormat\toFormattedString().

{
// Returnvalue
$returnValue = array();
// Garbage collect...
$this->garbageCollect();
// Get worksheet dimension
$dimension = explode(':', $this->calculateWorksheetDimension());
$dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]);
$dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1;
$dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]);
$dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1;
// Loop trough cells
for ($row = $dimension[0][1]; $row <= $dimension[1][1]; ++$row) {
for ($column = $dimension[0][0]; $column <= $dimension[1][0]; ++$column) {
// Cell exists?
if ($this->cellExistsByColumnAndRow($column, $row)) {
$cell = $this->getCellByColumnAndRow($column, $row);
if ($cell->getValue() instanceof PHPExcel_RichText) {
$returnValue[$row][$column] = $cell->getValue()->getPlainText();
} else {
if ($calculateFormulas) {
$returnValue[$row][$column] = $cell->getCalculatedValue();
} else {
$returnValue[$row][$column] = $cell->getValue();
}
}
$style = $this->_parent->getCellXfByIndex($cell->getXfIndex());
$returnValue[$row][$column] = PHPExcel_Style_NumberFormat::toFormattedString($returnValue[$row][$column], $style->getNumberFormat()->getFormatCode());
} else {
$returnValue[$row][$column] = $nullValue;
}
}
}
// Return
return $returnValue;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::unfreezePane ( )

Unfreeze Pane.

Returns
PHPExcel_Worksheet

Definition at line 1669 of file Worksheet.php.

References freezePane().

{
return $this->freezePane('');
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::unmergeCells (   $pRange = 'A1:A1')

Remove merge on a cell range.

Parameters
string$pRangeCell range (e.g. A1:E1)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1440 of file Worksheet.php.

Referenced by unmergeCellsByColumnAndRow().

:A1')
{
// Uppercase coordinate
$pRange = strtoupper($pRange);
if (strpos($pRange,':') !== false) {
if (isset($this->_mergeCells[$pRange])) {
unset($this->_mergeCells[$pRange]);
} else {
throw new Exception('Cell range ' . $pRange . ' not known as merged.');
}
} else {
throw new Exception('Merge can only be removed from a range of cells.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::unmergeCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 0,
  $pColumn2 = 0,
  $pRow2 = 0 
)

Remove merge on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1468 of file Worksheet.php.

References PHPExcel_Cell\stringFromColumnIndex(), and unmergeCells().

{
$cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
return $this->unmergeCells($cellRange);
}

+ Here is the call graph for this function:

PHPExcel_Worksheet::unprotectCells (   $pRange = 'A1')

Remove protection on a cell range.

Parameters
string$pRangeCell (e.g. A1) or cell range (e.g. A1:E1)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1531 of file Worksheet.php.

Referenced by unprotectCellsByColumnAndRow().

{
// Uppercase coordinate
$pRange = strtoupper($pRange);
if (isset($this->_protectedCells[$pRange])) {
unset($this->_protectedCells[$pRange]);
} else {
throw new Exception('Cell range ' . $pRange . ' not known as protected.');
}
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet::unprotectCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 0,
  $pColumn2 = 0,
  $pRow2 = 0,
  $pPassword = '',
  $pAlreadyHashed = false 
)

Remove protection on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
string$pPasswordPassword to unlock the protection
boolean$pAlreadyHashedIf the password has already been hashed, set this to true
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 1556 of file Worksheet.php.

References PHPExcel_Cell\stringFromColumnIndex(), and unprotectCells().

{
$cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed);
}

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Worksheet::$_autoFilter = ''
private

Definition at line 262 of file Worksheet.php.

Referenced by getAutoFilter().

PHPExcel_Worksheet::$_breaks = array()
private

Definition at line 241 of file Worksheet.php.

Referenced by getBreaks().

PHPExcel_Worksheet::$_cachedHighestColumn = null
private

Definition at line 332 of file Worksheet.php.

Referenced by getHighestColumn().

PHPExcel_Worksheet::$_cachedHighestRow = null
private

Definition at line 339 of file Worksheet.php.

Referenced by getHighestRow().

PHPExcel_Worksheet::$_cellCollection = array()
private

Definition at line 136 of file Worksheet.php.

Referenced by getCellCollection().

PHPExcel_Worksheet::$_cellCollectionIsSorted = false
private

Definition at line 234 of file Worksheet.php.

PHPExcel_Worksheet::$_columnDimensions = array()
private

Definition at line 157 of file Worksheet.php.

Referenced by getColumnDimensions().

PHPExcel_Worksheet::$_comments = array()
private

Definition at line 304 of file Worksheet.php.

Referenced by getComments().

PHPExcel_Worksheet::$_conditionalStylesCollection = array()
private

Definition at line 227 of file Worksheet.php.

Referenced by getConditionalStylesCollection().

PHPExcel_Worksheet::$_dataValidationCollection = array()
private

Definition at line 360 of file Worksheet.php.

Referenced by getDataValidationCollection().

PHPExcel_Worksheet::$_defaultColumnDimension = null
private

Definition at line 164 of file Worksheet.php.

Referenced by getDefaultColumnDimension().

PHPExcel_Worksheet::$_defaultRowDimension = null
private

Definition at line 150 of file Worksheet.php.

Referenced by getDefaultRowDimension().

PHPExcel_Worksheet::$_drawingCollection = null
private

Definition at line 171 of file Worksheet.php.

Referenced by getDrawingCollection().

PHPExcel_Worksheet::$_freezePane = ''
private

Definition at line 269 of file Worksheet.php.

Referenced by getFreezePane().

PHPExcel_Worksheet::$_hashIndex
private

Definition at line 2175 of file Worksheet.php.

Referenced by getHashIndex().

PHPExcel_Worksheet::$_headerFooter
private

Definition at line 199 of file Worksheet.php.

Referenced by getHeaderFooter().

PHPExcel_Worksheet::$_hyperlinkCollection = array()
private

Definition at line 353 of file Worksheet.php.

Referenced by getHyperlinkCollection().

PHPExcel_Worksheet::$_mergeCells = array()
private

Definition at line 248 of file Worksheet.php.

Referenced by getMergeCells().

PHPExcel_Worksheet::$_pageMargins
private

Definition at line 192 of file Worksheet.php.

Referenced by getPageMargins().

PHPExcel_Worksheet::$_pageSetup
private

Definition at line 185 of file Worksheet.php.

Referenced by getPageSetup().

PHPExcel_Worksheet::$_parent
private

Definition at line 129 of file Worksheet.php.

Referenced by duplicateStyle(), and getParent().

PHPExcel_Worksheet::$_printGridlines = false
private

Definition at line 283 of file Worksheet.php.

Referenced by getPrintGridlines().

PHPExcel_Worksheet::$_protectedCells = array()
private

Definition at line 255 of file Worksheet.php.

Referenced by getProtectedCells().

PHPExcel_Worksheet::$_protection
private

Definition at line 213 of file Worksheet.php.

Referenced by getProtection().

PHPExcel_Worksheet::$_rightToLeft = false
private

Definition at line 346 of file Worksheet.php.

Referenced by getRightToLeft().

PHPExcel_Worksheet::$_rowDimensions = array()
private

Definition at line 143 of file Worksheet.php.

Referenced by getRowDimensions().

PHPExcel_Worksheet::$_selectedCell = 'A1'
private

Definition at line 311 of file Worksheet.php.

Referenced by getSelectedCell().

PHPExcel_Worksheet::$_sheetView
private

Definition at line 206 of file Worksheet.php.

Referenced by getSheetView().

PHPExcel_Worksheet::$_showGridlines = true
private

Definition at line 276 of file Worksheet.php.

Referenced by getShowGridlines().

PHPExcel_Worksheet::$_showSummaryBelow = true
private

Definition at line 290 of file Worksheet.php.

Referenced by getShowSummaryBelow().

PHPExcel_Worksheet::$_showSummaryRight = true
private

Definition at line 297 of file Worksheet.php.

Referenced by getShowSummaryRight().

PHPExcel_Worksheet::$_styles = array()
private

Definition at line 220 of file Worksheet.php.

Referenced by getStyles().

PHPExcel_Worksheet::$_title
private

Definition at line 178 of file Worksheet.php.

Referenced by getTitle().

PHPExcel_Worksheet::$_xActiveCell = 'A1'
private

Definition at line 318 of file Worksheet.php.

Referenced by getXActiveCell().

PHPExcel_Worksheet::$_xSelectedCells = 'A1:A1'
private

Definition at line 325 of file Worksheet.php.

Referenced by getXSelectedCells().

const PHPExcel_Worksheet::BREAK_NONE = 0

The documentation for this class was generated from the following file: