Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • PHPExcel_Worksheet
  • PHPExcel_Worksheet_AutoFilter
  • PHPExcel_Worksheet_AutoFilter_Column
  • PHPExcel_Worksheet_AutoFilter_Column_Rule
  • PHPExcel_Worksheet_BaseDrawing
  • PHPExcel_Worksheet_CellIterator
  • PHPExcel_Worksheet_ColumnDimension
  • PHPExcel_Worksheet_HeaderFooter
  • PHPExcel_Worksheet_HeaderFooterDrawing
  • PHPExcel_Worksheet_MemoryDrawing
  • PHPExcel_Worksheet_PageMargins
  • PHPExcel_Worksheet_PageSetup
  • PHPExcel_Worksheet_Protection
  • PHPExcel_Worksheet_Row
  • PHPExcel_Worksheet_RowDimension
  • PHPExcel_Worksheet_RowIterator
  • PHPExcel_Worksheet_SheetView
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Class PHPExcel_Worksheet

PHPExcel_Worksheet

PHPExcel_Worksheet implements PHPExcel_IComparable
Package: PHPExcel\Worksheet
Category: PHPExcel
Copyright: Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
License: LGPL
Located at controlador/include/phpexcel/PHPExcel/Worksheet.php
Methods summary
public
# __construct( PHPExcel $pParent = null, string $pTitle = 'Worksheet' )

Create a new worksheet

Create a new worksheet

Parameters

$pParent
$pTitle
public
# disconnectCells( )

Disconnect all cells from this PHPExcel_Worksheet object, typically so that the worksheet object can be unset

Disconnect all cells from this PHPExcel_Worksheet object, typically so that the worksheet object can be unset

public
# __destruct( )

Code to execute when this worksheet is unset()

Code to execute when this worksheet is unset()

public PHPExcel_CachedObjectStorage_xxx
# getCellCacheController( )

Return the cache controller for the cell collection

Return the cache controller for the cell collection

Returns

PHPExcel_CachedObjectStorage_xxx
public static array
# getInvalidCharacters( )

Get array of invalid characters for sheet title

Get array of invalid characters for sheet title

Returns

array
private static string
# _checkSheetCodeName( string $pValue )

Check sheet code name for valid Excel syntax

Check sheet code name for valid Excel syntax

Parameters

$pValue
The string to check

Returns

string
The valid string

Throws

Exception
private static string
# _checkSheetTitle( string $pValue )

Check sheet title for valid Excel syntax

Check sheet title for valid Excel syntax

Parameters

$pValue
The string to check

Returns

string
The valid string

Throws

PHPExcel_Exception
public PHPExcel_Cell[]
# getCellCollection( boolean $pSorted = true )

Get collection of cells

Get collection of cells

Parameters

$pSorted
Also sort the cell collection?

Returns

PHPExcel_Cell[]
public PHPExcel_Worksheet
# sortCellCollection( )

Sort collection of cells

Sort collection of cells

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet_RowDimension[]
# getRowDimensions( )

Get collection of row dimensions

Get collection of row dimensions

Returns

PHPExcel_Worksheet_RowDimension[]
public PHPExcel_Worksheet_RowDimension
# getDefaultRowDimension( )

Get default row dimension

Get default row dimension

Returns

PHPExcel_Worksheet_RowDimension
public PHPExcel_Worksheet_ColumnDimension[]
# getColumnDimensions( )

Get collection of column dimensions

Get collection of column dimensions

Returns

PHPExcel_Worksheet_ColumnDimension[]
public PHPExcel_Worksheet_ColumnDimension
# getDefaultColumnDimension( )

Get default column dimension

Get default column dimension

Returns

PHPExcel_Worksheet_ColumnDimension
public PHPExcel_Worksheet_BaseDrawing[]
# getDrawingCollection( )

Get collection of drawings

Get collection of drawings

Returns

PHPExcel_Worksheet_BaseDrawing[]
public PHPExcel_Chart[]
# getChartCollection( )

Get collection of charts

Get collection of charts

Returns

PHPExcel_Chart[]
public PHPExcel_Chart
# addChart( PHPExcel_Chart $pChart = null, integer|null $iChartIndex = null )

Add chart

Add chart

Parameters

$pChart
$iChartIndex
Index where chart should go (0,1,..., or null for last)

Returns

PHPExcel_Chart
public integer
# getChartCount( )

Return the count of charts on this worksheet

Return the count of charts on this worksheet

Returns

integer
The number of charts
public false|PHPExcel_Chart
# getChartByIndex( string $index = null )

Get a chart by its index position

Get a chart by its index position

Parameters

$index
Chart index position

Returns

false|PHPExcel_Chart

Throws

PHPExcel_Exception
public string[]
# getChartNames( )

Return an array of the names of charts on this worksheet

Return an array of the names of charts on this worksheet

Returns

string[]
The names of charts

Throws

PHPExcel_Exception
public false|PHPExcel_Chart
# getChartByName( string $chartName = '' )

Get a chart by name

Get a chart by name

Parameters

$chartName
Chart name

Returns

false|PHPExcel_Chart

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# refreshColumnDimensions( )

Refresh column dimensions

Refresh column dimensions

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet
# refreshRowDimensions( )

Refresh row dimensions

Refresh row dimensions

Returns

PHPExcel_Worksheet
public string
# calculateWorksheetDimension( )

Calculate worksheet dimension

Calculate worksheet dimension

Returns

string
String containing the dimension of this worksheet
public string
# calculateWorksheetDataDimension( )

Calculate worksheet data dimension

Calculate worksheet data dimension

Returns

string
String containing the dimension of this worksheet that actually contain data
public PHPExcel_Worksheet;
# calculateColumnWidths( boolean $calculateMergeCells = false )

Calculate widths for auto-size columns

Calculate widths for auto-size columns

Parameters

$calculateMergeCells
Calculate merge cell width

Returns

PHPExcel_Worksheet;
public PHPExcel
# getParent( )

Get parent

Get parent

Returns

PHPExcel
public PHPExcel_Worksheet
# rebindParent( PHPExcel $parent )

Re-bind parent

Re-bind parent

Parameters

$parent

Returns

PHPExcel_Worksheet
public string
# getTitle( )

Get title

Get title

Returns

string
public PHPExcel_Worksheet
# setTitle( string $pValue = 'Worksheet', string $updateFormulaCellReferences = true )

Set title

Set title

Parameters

$pValue
String containing the dimension of this worksheet
$updateFormulaCellReferences

boolean Flag indicating whether cell references in formulae should be updated to reflect the new sheet name. This should be left as the default true, unless you are certain that no formula cells on any worksheet contain references to this worksheet

Returns

PHPExcel_Worksheet
public string
# getSheetState( )

Get sheet state

Get sheet state

Returns

string
Sheet state (visible, hidden, veryHidden)
public PHPExcel_Worksheet
# setSheetState( string $value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE )

Set sheet state

Set sheet state

Parameters

$value
Sheet state (visible, hidden, veryHidden)

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet_PageSetup
# getPageSetup( )

Get page setup

Get page setup

Returns

PHPExcel_Worksheet_PageSetup
public PHPExcel_Worksheet
# setPageSetup( PHPExcel_Worksheet_PageSetup $pValue )

Set page setup

Set page setup

Parameters

$pValue

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet_PageMargins
# getPageMargins( )

Get page margins

Get page margins

Returns

PHPExcel_Worksheet_PageMargins
public PHPExcel_Worksheet
# setPageMargins( PHPExcel_Worksheet_PageMargins $pValue )

Set page margins

Set page margins

Parameters

$pValue

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet_HeaderFooter
# getHeaderFooter( )

Get page header/footer

Get page header/footer

Returns

PHPExcel_Worksheet_HeaderFooter
public PHPExcel_Worksheet
# setHeaderFooter( PHPExcel_Worksheet_HeaderFooter $pValue )

Set page header/footer

Set page header/footer

Parameters

$pValue

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet_SheetView
# getSheetView( )

Get sheet view

Get sheet view

Returns

PHPExcel_Worksheet_SheetView
public PHPExcel_Worksheet
# setSheetView( PHPExcel_Worksheet_SheetView $pValue )

Set sheet view

Set sheet view

Parameters

$pValue

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet_Protection
# getProtection( )

Get Protection

Get Protection

Returns

PHPExcel_Worksheet_Protection
public PHPExcel_Worksheet
# setProtection( PHPExcel_Worksheet_Protection $pValue )

Set Protection

Set Protection

Parameters

$pValue

Returns

PHPExcel_Worksheet
public string
# getHighestColumn( string $row = null )

Get highest worksheet column

Get highest worksheet column

Parameters

$row

Return the data highest column for the specified row, or the highest column of any row if no row number is passed

Returns

string
Highest column name
public string
# getHighestDataColumn( string $row = null )

Get highest worksheet column that contains data

Get highest worksheet column that contains data

Parameters

$row

Return the highest data column for the specified row, or the highest data column of any row if no row number is passed

Returns

string
Highest column name that contains data
public integer
# getHighestRow( string $column = null )

Get highest worksheet row

Get highest worksheet row

Parameters

$column

Return the highest data row for the specified column, or the highest row of any column if no column letter is passed

Returns

integer
Highest row number
public string
# getHighestDataRow( string $column = null )

Get highest worksheet row that contains data

Get highest worksheet row that contains data

Parameters

$column

Return the highest data row for the specified column, or the highest data row of any column if no column letter is passed

Returns

string
Highest row number that contains data
public array
# getHighestRowAndColumn( )

Get highest worksheet column and highest row that have cell records

Get highest worksheet column and highest row that have cell records

Returns

array
Highest column name and highest row number
public PHPExcel_Worksheet|PHPExcel_Cell
# setCellValue( string $pCoordinate = 'A1', mixed $pValue = null, boolean $returnCell = false )

Set a cell value

Set a cell value

Parameters

$pCoordinate
Coordinate of the cell
$pValue
Value of the cell
$returnCell
Return the worksheet (false, default) or the cell (true)

Returns

PHPExcel_Worksheet|PHPExcel_Cell
Depending on the last parameter being specified
public PHPExcel_Worksheet|PHPExcel_Cell
# setCellValueByColumnAndRow( string $pColumn = 0, string $pRow = 1, mixed $pValue = null, boolean $returnCell = false )

Set a cell value by using numeric cell coordinates

Set a cell value by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell (A = 0)
$pRow
Numeric row coordinate of the cell
$pValue
Value of the cell
$returnCell
Return the worksheet (false, default) or the cell (true)

Returns

PHPExcel_Worksheet|PHPExcel_Cell
Depending on the last parameter being specified
public PHPExcel_Worksheet|PHPExcel_Cell
# setCellValueExplicit( string $pCoordinate = 'A1', mixed $pValue = null, string $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, boolean $returnCell = false )

Set a cell value

Set a cell value

Parameters

$pCoordinate
Coordinate of the cell
$pValue
Value of the cell
$pDataType
Explicit data type
$returnCell
Return the worksheet (false, default) or the cell (true)

Returns

PHPExcel_Worksheet|PHPExcel_Cell
Depending on the last parameter being specified
public PHPExcel_Worksheet|PHPExcel_Cell
# setCellValueExplicitByColumnAndRow( string $pColumn = 0, string $pRow = 1, mixed $pValue = null, string $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, boolean $returnCell = false )

Set a cell value by using numeric cell coordinates

Set a cell value by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell
$pValue
Value of the cell
$pDataType
Explicit data type
$returnCell
Return the worksheet (false, default) or the cell (true)

Returns

PHPExcel_Worksheet|PHPExcel_Cell
Depending on the last parameter being specified
public PHPExcel_Cell
# getCell( string $pCoordinate = 'A1' )

Get cell at a specific coordinate

Get cell at a specific coordinate

Parameters

$pCoordinate
Coordinate of the cell

Returns

PHPExcel_Cell
Cell that was found

Throws

PHPExcel_Exception
public PHPExcel_Cell
# getCellByColumnAndRow( string $pColumn = 0, string $pRow = 1 )

Get cell at a specific coordinate by using numeric cell coordinates

Get cell at a specific coordinate by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell

Returns

PHPExcel_Cell
Cell that was found
private PHPExcel_Cell
# _createNewCell( string $pCoordinate )

Create a new cell at the specified coordinate

Create a new cell at the specified coordinate

Parameters

$pCoordinate
Coordinate of the cell

Returns

PHPExcel_Cell
Cell that was created
public boolean
# cellExists( string $pCoordinate = 'A1' )

Does the cell at a specific coordinate exist?

Does the cell at a specific coordinate exist?

Parameters

$pCoordinate
Coordinate of the cell

Returns

boolean

Throws

PHPExcel_Exception
public boolean
# cellExistsByColumnAndRow( string $pColumn = 0, string $pRow = 1 )

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

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

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell

Returns

boolean
public PHPExcel_Worksheet_RowDimension
# getRowDimension( integer $pRow = 1, $create = TRUE )

Get row dimension at a specific row

Get row dimension at a specific row

Parameters

$pRow
Numeric index of the row
$create

Returns

PHPExcel_Worksheet_RowDimension
public PHPExcel_Worksheet_ColumnDimension
# getColumnDimension( string $pColumn = 'A', $create = TRUE )

Get column dimension at a specific column

Get column dimension at a specific column

Parameters

$pColumn
String index of the column
$create

Returns

PHPExcel_Worksheet_ColumnDimension
public PHPExcel_Worksheet_ColumnDimension
# getColumnDimensionByColumn( string $pColumn = 0 )

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

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

Parameters

$pColumn
Numeric column coordinate of the cell

Returns

PHPExcel_Worksheet_ColumnDimension
public PHPExcel_Style[]
# getStyles( )

Get styles

Get styles

Returns

PHPExcel_Style[]
public PHPExcel_Style
# getDefaultStyle( )

Get default style of workbook.

Get default style of workbook.

Deprecated

Returns

PHPExcel_Style

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# setDefaultStyle( PHPExcel_Style $pValue )

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

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

Deprecated

Parameters

$pValue

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Style
# getStyle( string $pCellCoordinate = 'A1' )

Get style for cell

Get style for cell

Parameters

$pCellCoordinate
Cell coordinate to get style for

Returns

PHPExcel_Style

Throws

PHPExcel_Exception
public PHPExcel_Style_Conditional[]
# getConditionalStyles( string $pCoordinate = 'A1' )

Get conditional styles for a cell

Get conditional styles for a cell

Parameters

$pCoordinate

Returns

PHPExcel_Style_Conditional[]
public boolean
# conditionalStylesExists( string $pCoordinate = 'A1' )

Do conditional styles exist for this cell?

Do conditional styles exist for this cell?

Parameters

$pCoordinate

Returns

boolean
public PHPExcel_Worksheet
# removeConditionalStyles( string $pCoordinate = 'A1' )

Removes conditional styles for a cell

Removes conditional styles for a cell

Parameters

$pCoordinate

Returns

PHPExcel_Worksheet
public array
# getConditionalStylesCollection( )

Get collection of conditional styles

Get collection of conditional styles

Returns

array
public PHPExcel_Worksheet
# setConditionalStyles( $pCoordinate, $pValue )

Set conditional styles

Set conditional styles

Parameters

$pCoordinate
E.g. 'A1'
$pValue
PHPExcel_Style_Conditional[]

Returns

PHPExcel_Worksheet
public PHPExcel_Style
# getStyleByColumnAndRow( integer $pColumn = 0, integer $pRow = 1 )

Get style for cell by using numeric cell coordinates

Get style for cell by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell

Returns

PHPExcel_Style
public PHPExcel_Worksheet
# setSharedStyle( PHPExcel_Style $pSharedCellStyle = null, string $pRange = '' )

Set shared cell style to a range of cells

Set shared cell style to a range of cells

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

Deprecated

Parameters

$pSharedCellStyle
Cell style to share
$pRange
Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# duplicateStyle( PHPExcel_Style $pCellStyle = null, string $pRange = '' )

Duplicate cell style to a range of cells

Duplicate cell style to a range of cells

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

Parameters

$pCellStyle
Cell style to duplicate
$pRange
Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# duplicateConditionalStyle( array $pCellStyle = null, string $pRange = '' )

Duplicate conditional style to a range of cells

Duplicate conditional style to a range of cells

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

Parameters

$pCellStyle
PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate
$pRange
Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# duplicateStyleArray( array $pStyles = null, string $pRange = '', boolean $pAdvanced = true )

Duplicate cell style array to a range of cells

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

$pStyles
Array containing style information
$pRange
Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
$pAdvanced
Advanced mode for setting borders.

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# setBreak( string $pCell = 'A1', integer $pBreak = PHPExcel_Worksheet::BREAK_NONE )

Set break on a cell

Set break on a cell

Parameters

$pCell
Cell coordinate (e.g. A1)
$pBreak
Break type (type of PHPExcel_Worksheet::BREAK_*)

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# setBreakByColumnAndRow( integer $pColumn = 0, integer $pRow = 1, integer $pBreak = PHPExcel_Worksheet::BREAK_NONE )

Set break on a cell by using numeric cell coordinates

Set break on a cell by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell
$pBreak
Break type (type of PHPExcel_Worksheet::BREAK_*)

Returns

PHPExcel_Worksheet
public array[]
# getBreaks( )

Get breaks

Get breaks

Returns

array[]
public PHPExcel_Worksheet
# mergeCells( string $pRange = 'A1:A1' )

Set merge on a cell range

Set merge on a cell range

Parameters

$pRange
Cell range (e.g. A1:E1)

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# mergeCellsByColumnAndRow( integer $pColumn1 = 0, integer $pRow1 = 1, integer $pColumn2 = 0, integer $pRow2 = 1 )

Set merge on a cell range by using numeric cell coordinates

Set merge on a cell range by using numeric cell coordinates

Parameters

$pColumn1
Numeric column coordinate of the first cell
$pRow1
Numeric row coordinate of the first cell
$pColumn2
Numeric column coordinate of the last cell
$pRow2
Numeric row coordinate of the last cell

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# unmergeCells( string $pRange = 'A1:A1' )

Remove merge on a cell range

Remove merge on a cell range

Parameters

$pRange
Cell range (e.g. A1:E1)

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# unmergeCellsByColumnAndRow( integer $pColumn1 = 0, integer $pRow1 = 1, integer $pColumn2 = 0, integer $pRow2 = 1 )

Remove merge on a cell range by using numeric cell coordinates

Remove merge on a cell range by using numeric cell coordinates

Parameters

$pColumn1
Numeric column coordinate of the first cell
$pRow1
Numeric row coordinate of the first cell
$pColumn2
Numeric column coordinate of the last cell
$pRow2
Numeric row coordinate of the last cell

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public array[]
# getMergeCells( )

Get merge cells array.

Get merge cells array.

Returns

array[]
public
# setMergeCells( array $pValue = array() )

Set merge cells array for the entire sheet. Use instead mergeCells() to merge a single cell range.

Set merge cells array for the entire sheet. Use instead mergeCells() to merge a single cell range.

Parameters

$pValue
public PHPExcel_Worksheet
# protectCells( string $pRange = 'A1', string $pPassword = '', boolean $pAlreadyHashed = false )

Set protection on a cell range

Set protection on a cell range

Parameters

$pRange
Cell (e.g. A1) or cell range (e.g. A1:E1)
$pPassword
Password to unlock the protection
$pAlreadyHashed
If the password has already been hashed, set this to true

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# protectCellsByColumnAndRow( integer $pColumn1 = 0, integer $pRow1 = 1, integer $pColumn2 = 0, integer $pRow2 = 1, string $pPassword = '', boolean $pAlreadyHashed = false )

Set protection on a cell range by using numeric cell coordinates

Set protection on a cell range by using numeric cell coordinates

Parameters

$pColumn1
Numeric column coordinate of the first cell
$pRow1
Numeric row coordinate of the first cell
$pColumn2
Numeric column coordinate of the last cell
$pRow2
Numeric row coordinate of the last cell
$pPassword
Password to unlock the protection
$pAlreadyHashed
If the password has already been hashed, set this to true

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# unprotectCells( string $pRange = 'A1' )

Remove protection on a cell range

Remove protection on a cell range

Parameters

$pRange
Cell (e.g. A1) or cell range (e.g. A1:E1)

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# unprotectCellsByColumnAndRow( integer $pColumn1 = 0, integer $pRow1 = 1, integer $pColumn2 = 0, integer $pRow2 = 1, string $pPassword = '', boolean $pAlreadyHashed = false )

Remove protection on a cell range by using numeric cell coordinates

Remove protection on a cell range by using numeric cell coordinates

Parameters

$pColumn1
Numeric column coordinate of the first cell
$pRow1
Numeric row coordinate of the first cell
$pColumn2
Numeric column coordinate of the last cell
$pRow2
Numeric row coordinate of the last cell
$pPassword
Password to unlock the protection
$pAlreadyHashed
If the password has already been hashed, set this to true

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public array[]
# getProtectedCells( )

Get protected cells

Get protected cells

Returns

array[]
public PHPExcel_Worksheet_AutoFilter
# getAutoFilter( )

Get Autofilter

Get Autofilter

Returns

PHPExcel_Worksheet_AutoFilter
public PHPExcel_Worksheet
# setAutoFilter( PHPExcel_Worksheet_AutoFilter|string $pValue )

Set AutoFilter

Set AutoFilter

Parameters

$pValue
A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# setAutoFilterByColumnAndRow( integer $pColumn1 = 0, integer $pRow1 = 1, integer $pColumn2 = 0, integer $pRow2 = 1 )

Set Autofilter Range by using numeric cell coordinates

Set Autofilter Range by using numeric cell coordinates

Parameters

$pColumn1
Numeric column coordinate of the first cell
$pRow1
Numeric row coordinate of the first cell
$pColumn2
Numeric column coordinate of the second cell
$pRow2
Numeric row coordinate of the second cell

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# removeAutoFilter( )

Remove autofilter

Remove autofilter

Returns

PHPExcel_Worksheet
public string
# getFreezePane( )

Get Freeze Pane

Get Freeze Pane

Returns

string
public PHPExcel_Worksheet
# freezePane( string $pCell = '' )

Freeze Pane

Freeze Pane

Parameters

$pCell

Cell (i.e. A2) Examples: A2 will freeze the rows above cell A2 (i.e row 1) B1 will freeze the columns to the left of cell B1 (i.e column A) B2 will freeze the rows above and to the left of cell A2 (i.e row 1 and column A)

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# freezePaneByColumnAndRow( integer $pColumn = 0, integer $pRow = 1 )

Freeze Pane by using numeric cell coordinates

Freeze Pane by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# unfreezePane( )

Unfreeze Pane

Unfreeze Pane

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet
# insertNewRowBefore( integer $pBefore = 1, integer $pNumRows = 1 )

Insert a new row, updating all possible related data

Insert a new row, updating all possible related data

Parameters

$pBefore
Insert before this one
$pNumRows
Number of rows to insert

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# insertNewColumnBefore( integer $pBefore = 'A', integer $pNumCols = 1 )

Insert a new column, updating all possible related data

Insert a new column, updating all possible related data

Parameters

$pBefore
Insert before this one
$pNumCols
Number of columns to insert

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# insertNewColumnBeforeByIndex( integer $pBefore = 0, integer $pNumCols = 1 )

Insert a new column, updating all possible related data

Insert a new column, updating all possible related data

Parameters

$pBefore
Insert before this one (numeric column coordinate of the cell)
$pNumCols
Number of columns to insert

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# removeRow( integer $pRow = 1, integer $pNumRows = 1 )

Delete a row, updating all possible related data

Delete a row, updating all possible related data

Parameters

$pRow
Remove starting with this one
$pNumRows
Number of rows to remove

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# removeColumn( integer $pColumn = 'A', integer $pNumCols = 1 )

Remove a column, updating all possible related data

Remove a column, updating all possible related data

Parameters

$pColumn
Remove starting with this one
$pNumCols
Number of columns to remove

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# removeColumnByIndex( integer $pColumn = 0, integer $pNumCols = 1 )

Remove a column, updating all possible related data

Remove a column, updating all possible related data

Parameters

$pColumn
Remove starting with this one (numeric column coordinate of the cell)
$pNumCols
Number of columns to remove

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public boolean
# getShowGridlines( )

Show gridlines?

Show gridlines?

Returns

boolean
public PHPExcel_Worksheet
# setShowGridlines( boolean $pValue = false )

Set show gridlines

Set show gridlines

Parameters

$pValue
Show gridlines (true/false)

Returns

PHPExcel_Worksheet
public boolean
# getPrintGridlines( )

Print gridlines?

Print gridlines?

Returns

boolean
public PHPExcel_Worksheet
# setPrintGridlines( boolean $pValue = false )

Set print gridlines

Set print gridlines

Parameters

$pValue
Print gridlines (true/false)

Returns

PHPExcel_Worksheet
public boolean
# getShowRowColHeaders( )

Show row and column headers?

Show row and column headers?

Returns

boolean
public PHPExcel_Worksheet
# setShowRowColHeaders( boolean $pValue = false )

Set show row and column headers

Set show row and column headers

Parameters

$pValue
Show row and column headers (true/false)

Returns

PHPExcel_Worksheet
public boolean
# getShowSummaryBelow( )

Show summary below? (Row/Column outlining)

Show summary below? (Row/Column outlining)

Returns

boolean
public PHPExcel_Worksheet
# setShowSummaryBelow( boolean $pValue = true )

Set show summary below

Set show summary below

Parameters

$pValue
Show summary below (true/false)

Returns

PHPExcel_Worksheet
public boolean
# getShowSummaryRight( )

Show summary right? (Row/Column outlining)

Show summary right? (Row/Column outlining)

Returns

boolean
public PHPExcel_Worksheet
# setShowSummaryRight( boolean $pValue = true )

Set show summary right

Set show summary right

Parameters

$pValue
Show summary right (true/false)

Returns

PHPExcel_Worksheet
public PHPExcel_Comment[]
# getComments( )

Get comments

Get comments

Returns

PHPExcel_Comment[]
public PHPExcel_Worksheet
# setComments( array $pValue = array() )

Set comments array for the entire sheet.

Set comments array for the entire sheet.

Parameters

$pValue
PHPExcel_Comment

Returns

PHPExcel_Worksheet
public PHPExcel_Comment
# getComment( string $pCellCoordinate = 'A1' )

Get comment for cell

Get comment for cell

Parameters

$pCellCoordinate
Cell coordinate to get comment for

Returns

PHPExcel_Comment

Throws

PHPExcel_Exception
public PHPExcel_Comment
# getCommentByColumnAndRow( integer $pColumn = 0, integer $pRow = 1 )

Get comment for cell by using numeric cell coordinates

Get comment for cell by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell

Returns

PHPExcel_Comment
public string
# getSelectedCell( )

Get selected cell

Get selected cell

Deprecated

Returns

string
public string
# getActiveCell( )

Get active cell

Get active cell

Returns

string
Example: 'A1'
public string
# getSelectedCells( )

Get selected cells

Get selected cells

Returns

string
public PHPExcel_Worksheet
# setSelectedCell( string $pCoordinate = 'A1' )

Selected cell

Selected cell

Parameters

$pCoordinate
Cell (i.e. A1)

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet
# setSelectedCells( string $pCoordinate = 'A1' )

Select a range of cells.

Select a range of cells.

Parameters

$pCoordinate
Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public PHPExcel_Worksheet
# setSelectedCellByColumnAndRow( integer $pColumn = 0, integer $pRow = 1 )

Selected cell by using numeric cell coordinates

Selected cell by using numeric cell coordinates

Parameters

$pColumn
Numeric column coordinate of the cell
$pRow
Numeric row coordinate of the cell

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public boolean
# getRightToLeft( )

Get right-to-left

Get right-to-left

Returns

boolean
public PHPExcel_Worksheet
# setRightToLeft( boolean $value = false )

Set right-to-left

Set right-to-left

Parameters

$value
Right-to-left true/false

Returns

PHPExcel_Worksheet
public PHPExcel_Worksheet
# fromArray( array $source = null, mixed $nullValue = null, string $startCell = 'A1', boolean $strictNullComparison = false )

Fill worksheet from values in array

Fill worksheet from values in array

Parameters

$source
Source array
$nullValue
Value in source array that stands for blank cell
$startCell
Insert array starting from this cell address as the top left coordinate
$strictNullComparison
Apply strict comparison when testing for null values in the array

Returns

PHPExcel_Worksheet

Throws

PHPExcel_Exception
public array
# rangeToArray( string $pRange = 'A1', mixed $nullValue = null, boolean $calculateFormulas = true, boolean $formatData = true, boolean $returnCellRef = false )

Create array from a range of cells

Create array from a range of cells

Parameters

$pRange
Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
$nullValue
Value returned in the array entry if a cell doesn't exist
$calculateFormulas
Should formulas be calculated?
$formatData
Should formatting be applied to cell values?
$returnCellRef

False - Return a simple array of rows and columns indexed by number counting from zero True - Return rows and columns indexed by their actual row and column IDs

Returns

array
public array
# namedRangeToArray( string $pNamedRange = '', mixed $nullValue = null, boolean $calculateFormulas = true, boolean $formatData = true, boolean $returnCellRef = false )

Create array from a range of cells

Create array from a range of cells

Parameters

$pNamedRange
Name of the Named Range
$nullValue
Value returned in the array entry if a cell doesn't exist
$calculateFormulas
Should formulas be calculated?
$formatData
Should formatting be applied to cell values?
$returnCellRef

False - Return a simple array of rows and columns indexed by number counting from zero True - Return rows and columns indexed by their actual row and column IDs

Returns

array

Throws

PHPExcel_Exception
public array
# toArray( mixed $nullValue = null, boolean $calculateFormulas = true, boolean $formatData = true, boolean $returnCellRef = false )

Create array from worksheet

Create array from worksheet

Parameters

$nullValue
Value returned in the array entry if a cell doesn't exist
$calculateFormulas
Should formulas be calculated?
$formatData
Should formatting be applied to cell values?
$returnCellRef

False - Return a simple array of rows and columns indexed by number counting from zero True - Return rows and columns indexed by their actual row and column IDs

Returns

array
public PHPExcel_Worksheet_RowIterator
# getRowIterator( integer $startRow = 1 )

Get row iterator

Get row iterator

Parameters

$startRow
The row number at which to start iterating

Returns

PHPExcel_Worksheet_RowIterator
public PHPExcel_Worksheet
# garbageCollect( )

Run PHPExcel garabage collector.

Run PHPExcel garabage collector.

Returns

PHPExcel_Worksheet
public string
# getHashCode( )

Get hash code

Get hash code

Returns

string
Hash code

Implementation of

PHPExcel_IComparable::getHashCode()
public static mixed
# extractSheetTitle( string $pRange, boolean $returnRange = false )

Extract worksheet title from range.

Extract worksheet title from range.

Example: extractSheetTitle("testSheet!A1") ==> 'A1' Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1');

Parameters

$pRange
Range to extract title from
$returnRange
Return range? (see example)

Returns

mixed
public
# getHyperlink( string $pCellCoordinate = 'A1' )

Get hyperlink

Get hyperlink

Parameters

$pCellCoordinate
Cell coordinate to get hyperlink for
public PHPExcel_Worksheet
# setHyperlink( string $pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null )

Set hyperlnk

Set hyperlnk

Parameters

$pCellCoordinate
Cell coordinate to insert hyperlink
$pHyperlink

Returns

PHPExcel_Worksheet
public boolean
# hyperlinkExists( string $pCoordinate = 'A1' )

Hyperlink at a specific coordinate exists?

Hyperlink at a specific coordinate exists?

Parameters

$pCoordinate

Returns

boolean
public PHPExcel_Cell_Hyperlink[]
# getHyperlinkCollection( )

Get collection of hyperlinks

Get collection of hyperlinks

Returns

PHPExcel_Cell_Hyperlink[]
public
# getDataValidation( string $pCellCoordinate = 'A1' )

Get data validation

Get data validation

Parameters

$pCellCoordinate
Cell coordinate to get data validation for
public PHPExcel_Worksheet
# setDataValidation( string $pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null )

Set data validation

Set data validation

Parameters

$pCellCoordinate
Cell coordinate to insert data validation
$pDataValidation

Returns

PHPExcel_Worksheet
public boolean
# dataValidationExists( string $pCoordinate = 'A1' )

Data validation at a specific coordinate exists?

Data validation at a specific coordinate exists?

Parameters

$pCoordinate

Returns

boolean
public PHPExcel_Cell_DataValidation[]
# getDataValidationCollection( )

Get collection of data validations

Get collection of data validations

Returns

PHPExcel_Cell_DataValidation[]
public string
# shrinkRangeToFit( string $range )

Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet

Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet

Parameters

$range

Returns

string
Adjusted range value
public PHPExcel_Style_Color
# getTabColor( )

Get tab color

Get tab color

Returns

PHPExcel_Style_Color
public PHPExcel_Worksheet
# resetTabColor( )

Reset tab color

Reset tab color

Returns

PHPExcel_Worksheet
public boolean
# isTabColorSet( )

Tab color set?

Tab color set?

Returns

boolean
public PHPExcel_Worksheet
# copy( )

Copy worksheet (!= clone!)

Copy worksheet (!= clone!)

Returns

PHPExcel_Worksheet
public
# __clone( )

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

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

public objWorksheet
# setCodeName( null|string $pValue = null )

Define the code name of the sheet

Define the code name of the sheet

Parameters

$pValue
rule as Title minus space not allowed (but, like Excel, change silently space to underscore)

Returns

objWorksheet

Throws

PHPExcel_Exception
public null|string
# getCodeName( )

Return the code name of the sheet

Return the code name of the sheet

Returns

null|string
public boolean
# hasCodeName( )

Sheet has a code name ?

Sheet has a code name ?

Returns

boolean
Constants summary
integer BREAK_NONE
# 0
integer BREAK_ROW
# 1
integer BREAK_COLUMN
# 2
string SHEETSTATE_VISIBLE
# 'visible'
string SHEETSTATE_HIDDEN
# 'hidden'
string SHEETSTATE_VERYHIDDEN
# 'veryHidden'
Properties summary
private static array $_invalidCharacters

Invalid characters in sheet title

Invalid characters in sheet title

# array('*', ':', '/', '\\', '?', '[', ']')
private PHPExcel $_parent

Parent spreadsheet

Parent spreadsheet

#
private PHPExcel_CachedObjectStorage_xxx $_cellCollection

Cacheable collection of cells

Cacheable collection of cells

# null
private PHPExcel_Worksheet_RowDimension[] $_rowDimensions

Collection of row dimensions

Collection of row dimensions

# array()
private PHPExcel_Worksheet_RowDimension $_defaultRowDimension

Default row dimension

Default row dimension

# null
private PHPExcel_Worksheet_ColumnDimension[] $_columnDimensions

Collection of column dimensions

Collection of column dimensions

# array()
private PHPExcel_Worksheet_ColumnDimension $_defaultColumnDimension

Default column dimension

Default column dimension

# null
private PHPExcel_Worksheet_BaseDrawing[] $_drawingCollection

Collection of drawings

Collection of drawings

# null
private PHPExcel_Chart[] $_chartCollection

Collection of Chart objects

Collection of Chart objects

# array()
private string $_title

Worksheet title

Worksheet title

#
private string $_sheetState

Sheet state

Sheet state

#
private PHPExcel_Worksheet_PageSetup $_pageSetup

Page setup

Page setup

#
private PHPExcel_Worksheet_PageMargins $_pageMargins

Page margins

Page margins

#
private PHPExcel_Worksheet_HeaderFooter $_headerFooter

Page header/footer

Page header/footer

#
private PHPExcel_Worksheet_SheetView $_sheetView

Sheet view

Sheet view

#
private PHPExcel_Worksheet_Protection $_protection

Protection

Protection

#
private PHPExcel_Style[] $_styles

Collection of styles

Collection of styles

# array()
private array $_conditionalStylesCollection

Conditional styles. Indexed by cell coordinate, e.g. 'A1'

Conditional styles. Indexed by cell coordinate, e.g. 'A1'

# array()
private boolean $_cellCollectionIsSorted

Is the current cell collection sorted already?

Is the current cell collection sorted already?

# false
private array $_breaks

Collection of breaks

Collection of breaks

# array()
private array $_mergeCells

Collection of merged cell ranges

Collection of merged cell ranges

# array()
private array $_protectedCells

Collection of protected cell ranges

Collection of protected cell ranges

# array()
private PHPExcel_Worksheet_AutoFilter $_autoFilter

Autofilter Range and selection

Autofilter Range and selection

# NULL
private string $_freezePane

Freeze pane

Freeze pane

# ''
private boolean $_showGridlines

Show gridlines?

Show gridlines?

# true
private boolean $_printGridlines

Print gridlines?

Print gridlines?

# false
private boolean $_showRowColHeaders

Show row and column headers?

Show row and column headers?

# true
private boolean $_showSummaryBelow

Show summary below? (Row/Column outline)

Show summary below? (Row/Column outline)

# true
private boolean $_showSummaryRight

Show summary right? (Row/Column outline)

Show summary right? (Row/Column outline)

# true
private PHPExcel_Comment[] $_comments

Collection of comments

Collection of comments

# array()
private string $_activeCell

Active cell. (Only one!)

Active cell. (Only one!)

# 'A1'
private string $_selectedCells

Selected cells

Selected cells

# 'A1'
private string $_cachedHighestColumn

Cached highest column

Cached highest column

# 'A'
private integer $_cachedHighestRow

Cached highest row

Cached highest row

# 1
private boolean $_rightToLeft

Right-to-left?

Right-to-left?

# false
private array $_hyperlinkCollection

Hyperlinks. Indexed by cell coordinate, e.g. 'A1'

Hyperlinks. Indexed by cell coordinate, e.g. 'A1'

# array()
private array $_dataValidationCollection

Data validation objects. Indexed by cell coordinate, e.g. 'A1'

Data validation objects. Indexed by cell coordinate, e.g. 'A1'

# array()
private PHPExcel_Style_Color $_tabColor

Tab color

Tab color

#
private boolean $_dirty

Dirty flag

Dirty flag

# true
private string $_hash

Hash

Hash

# null
private string $_codeName

CodeName

CodeName

# null
Autene API documentation generated by ApiGen