BlueSpice MediaWiki REL1_27
 All Classes 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')
 
 disconnectCells ()
 
 __destruct ()
 
 getCellCacheController ()
 
 getCellCollection ($pSorted=true)
 
 sortCellCollection ()
 
 getRowDimensions ()
 
 getDefaultRowDimension ()
 
 getColumnDimensions ()
 
 getDefaultColumnDimension ()
 
 getDrawingCollection ()
 
 getChartCollection ()
 
 addChart (PHPExcel_Chart $pChart=null, $iChartIndex=null)
 
 getChartCount ()
 
 getChartByIndex ($index=null)
 
 getChartNames ()
 
 getChartByName ($chartName= '')
 
 refreshColumnDimensions ()
 
 refreshRowDimensions ()
 
 calculateWorksheetDimension ()
 
 calculateWorksheetDataDimension ()
 
 calculateColumnWidths ($calculateMergeCells=false)
 
 getParent ()
 
 rebindParent (PHPExcel $parent)
 
 getTitle ()
 
 setTitle ($pValue= 'Worksheet', $updateFormulaCellReferences=true)
 
 getSheetState ()
 
 setSheetState ($value=PHPExcel_Worksheet::SHEETSTATE_VISIBLE)
 
 getPageSetup ()
 
 setPageSetup (PHPExcel_Worksheet_PageSetup $pValue)
 
 getPageMargins ()
 
 setPageMargins (PHPExcel_Worksheet_PageMargins $pValue)
 
 getHeaderFooter ()
 
 setHeaderFooter (PHPExcel_Worksheet_HeaderFooter $pValue)
 
 getSheetView ()
 
 setSheetView (PHPExcel_Worksheet_SheetView $pValue)
 
 getProtection ()
 
 setProtection (PHPExcel_Worksheet_Protection $pValue)
 
 getHighestColumn ($row=null)
 
 getHighestDataColumn ($row=null)
 
 getHighestRow ($column=null)
 
 getHighestDataRow ($column=null)
 
 getHighestRowAndColumn ()
 
 setCellValue ($pCoordinate= 'A1', $pValue=null, $returnCell=false)
 
 setCellValueByColumnAndRow ($pColumn=0, $pRow=1, $pValue=null, $returnCell=false)
 
 setCellValueExplicit ($pCoordinate= 'A1', $pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING, $returnCell=false)
 
 setCellValueExplicitByColumnAndRow ($pColumn=0, $pRow=1, $pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING, $returnCell=false)
 
 getCell ($pCoordinate= 'A1')
 
 getCellByColumnAndRow ($pColumn=0, $pRow=1)
 
 cellExists ($pCoordinate= 'A1')
 
 cellExistsByColumnAndRow ($pColumn=0, $pRow=1)
 
 getRowDimension ($pRow=1, $create=TRUE)
 
 getColumnDimension ($pColumn= 'A', $create=TRUE)
 
 getColumnDimensionByColumn ($pColumn=0)
 
 getStyles ()
 
 getDefaultStyle ()
 
 setDefaultStyle (PHPExcel_Style $pValue)
 
 getStyle ($pCellCoordinate= 'A1')
 
 getConditionalStyles ($pCoordinate= 'A1')
 
 conditionalStylesExists ($pCoordinate= 'A1')
 
 removeConditionalStyles ($pCoordinate= 'A1')
 
 getConditionalStylesCollection ()
 
 setConditionalStyles ($pCoordinate= 'A1', $pValue)
 
 getStyleByColumnAndRow ($pColumn=0, $pRow=1)
 
 setSharedStyle (PHPExcel_Style $pSharedCellStyle=null, $pRange= '')
 
 duplicateStyle (PHPExcel_Style $pCellStyle=null, $pRange= '')
 
 duplicateConditionalStyle (array $pCellStyle=null, $pRange= '')
 
 duplicateStyleArray ($pStyles=null, $pRange= '', $pAdvanced=true)
 
 setBreak ($pCell= 'A1', $pBreak=PHPExcel_Worksheet::BREAK_NONE)
 
 setBreakByColumnAndRow ($pColumn=0, $pRow=1, $pBreak=PHPExcel_Worksheet::BREAK_NONE)
 
 getBreaks ()
 
 mergeCells ($pRange= 'A1:A1')
 
 mergeCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1)
 
 unmergeCells ($pRange= 'A1:A1')
 
 unmergeCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1)
 
 getMergeCells ()
 
 setMergeCells ($pValue=array())
 
 protectCells ($pRange= 'A1', $pPassword= '', $pAlreadyHashed=false)
 
 protectCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1, $pPassword= '', $pAlreadyHashed=false)
 
 unprotectCells ($pRange= 'A1')
 
 unprotectCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1, $pPassword= '', $pAlreadyHashed=false)
 
 getProtectedCells ()
 
 getAutoFilter ()
 
 setAutoFilter ($pValue)
 
 setAutoFilterByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1)
 
 removeAutoFilter ()
 
 getFreezePane ()
 
 freezePane ($pCell= '')
 
 freezePaneByColumnAndRow ($pColumn=0, $pRow=1)
 
 unfreezePane ()
 
 insertNewRowBefore ($pBefore=1, $pNumRows=1)
 
 insertNewColumnBefore ($pBefore= 'A', $pNumCols=1)
 
 insertNewColumnBeforeByIndex ($pBefore=0, $pNumCols=1)
 
 removeRow ($pRow=1, $pNumRows=1)
 
 removeColumn ($pColumn= 'A', $pNumCols=1)
 
 removeColumnByIndex ($pColumn=0, $pNumCols=1)
 
 getShowGridlines ()
 
 setShowGridlines ($pValue=false)
 
 getPrintGridlines ()
 
 setPrintGridlines ($pValue=false)
 
 getShowRowColHeaders ()
 
 setShowRowColHeaders ($pValue=false)
 
 getShowSummaryBelow ()
 
 setShowSummaryBelow ($pValue=true)
 
 getShowSummaryRight ()
 
 setShowSummaryRight ($pValue=true)
 
 getComments ()
 
 setComments ($pValue=array())
 
 getComment ($pCellCoordinate= 'A1')
 
 getCommentByColumnAndRow ($pColumn=0, $pRow=1)
 
 getSelectedCell ()
 
 getActiveCell ()
 
 getSelectedCells ()
 
 setSelectedCell ($pCoordinate= 'A1')
 
 setSelectedCells ($pCoordinate= 'A1')
 
 setSelectedCellByColumnAndRow ($pColumn=0, $pRow=1)
 
 getRightToLeft ()
 
 setRightToLeft ($value=false)
 
 fromArray ($source=null, $nullValue=null, $startCell= 'A1', $strictNullComparison=false)
 
 rangeToArray ($pRange= 'A1', $nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
 
 namedRangeToArray ($pNamedRange= '', $nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
 
 toArray ($nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
 
 getRowIterator ($startRow=1)
 
 garbageCollect ()
 
 getHashCode ()
 
 getHyperlink ($pCellCoordinate= 'A1')
 
 setHyperlink ($pCellCoordinate= 'A1', PHPExcel_Cell_Hyperlink $pHyperlink=null)
 
 hyperlinkExists ($pCoordinate= 'A1')
 
 getHyperlinkCollection ()
 
 getDataValidation ($pCellCoordinate= 'A1')
 
 setDataValidation ($pCellCoordinate= 'A1', PHPExcel_Cell_DataValidation $pDataValidation=null)
 
 dataValidationExists ($pCoordinate= 'A1')
 
 getDataValidationCollection ()
 
 shrinkRangeToFit ($range)
 
 getTabColor ()
 
 resetTabColor ()
 
 isTabColorSet ()
 
 copy ()
 
 __clone ()
 
 setCodeName ($pValue=null)
 
 getCodeName ()
 
 hasCodeName ()
 

Static Public Member Functions

static getInvalidCharacters ()
 
static extractSheetTitle ($pRange, $returnRange=false)
 

Public Attributes

const BREAK_NONE = 0
 
const BREAK_ROW = 1
 
const BREAK_COLUMN = 2
 
const SHEETSTATE_VISIBLE = 'visible'
 
const SHEETSTATE_HIDDEN = 'hidden'
 
const SHEETSTATE_VERYHIDDEN = 'veryHidden'
 

Constructor & Destructor Documentation

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

Create a new worksheet

Parameters
PHPExcel$pParent
string$pTitle
PHPExcel_Worksheet::__destruct ( )

Code to execute when this worksheet is unset()

Member Function Documentation

PHPExcel_Worksheet::__clone ( )

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

PHPExcel_Worksheet::addChart ( PHPExcel_Chart  $pChart = null,
  $iChartIndex = null 
)

Add chart

Parameters
PHPExcel_Chart$pChart
int | null$iChartIndexIndex where chart should go (0,1,..., or null for last)
Returns
PHPExcel_Chart
PHPExcel_Worksheet::calculateColumnWidths (   $calculateMergeCells = false)

Calculate widths for auto-size columns

Parameters
boolean$calculateMergeCellsCalculate merge cell width
Returns
PHPExcel_Worksheet;
PHPExcel_Worksheet::calculateWorksheetDataDimension ( )

Calculate worksheet data dimension

Returns
string String containing the dimension of this worksheet that actually contain data
PHPExcel_Worksheet::calculateWorksheetDimension ( )

Calculate worksheet dimension

Returns
string String containing the dimension of this worksheet
PHPExcel_Worksheet::cellExists (   $pCoordinate = 'A1')

Does the cell at a specific coordinate exist?

Parameters
string$pCoordinateCoordinate of the cell
Exceptions
PHPExcel_Exception
Returns
boolean
PHPExcel_Worksheet::cellExistsByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

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
PHPExcel_Worksheet::conditionalStylesExists (   $pCoordinate = 'A1')

Do conditional styles exist for this cell?

Parameters
string$pCoordinate
Returns
boolean
PHPExcel_Worksheet::copy ( )

Copy worksheet (!= clone!)

Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::dataValidationExists (   $pCoordinate = 'A1')

Data validation at a specific coordinate exists?

Parameters
string$pCoordinate
Returns
boolean
PHPExcel_Worksheet::disconnectCells ( )

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

PHPExcel_Worksheet::duplicateConditionalStyle ( array  $pCellStyle = null,
  $pRange = '' 
)

Duplicate conditional style to a range of cells

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

Parameters
arrayof PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
static PHPExcel_Worksheet::extractSheetTitle (   $pRange,
  $returnRange = false 
)
static

Extract worksheet title from range.

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

Parameters
string$pRangeRange to extract title from
bool$returnRangeReturn range? (see example)
Returns
mixed
PHPExcel_Worksheet::freezePane (   $pCell = '')

Freeze Pane

Parameters
string$pCellCell (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)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::freezePaneByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Freeze Pane by using numeric cell coordinates

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::fromArray (   $source = null,
  $nullValue = null,
  $startCell = 'A1',
  $strictNullComparison = false 
)

Fill worksheet from values in array

Parameters
array$sourceSource array
mixed$nullValueValue in source array that stands for blank cell
string$startCellInsert array starting from this cell address as the top left coordinate
boolean$strictNullComparisonApply strict comparison when testing for null values in the array
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::garbageCollect ( )

Run PHPExcel garabage collector.

Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::getActiveCell ( )

Get active cell

Returns
string Example: 'A1'
PHPExcel_Worksheet::getAutoFilter ( )

Get Autofilter

Returns
PHPExcel_Worksheet_AutoFilter
PHPExcel_Worksheet::getBreaks ( )

Get breaks

Returns
array[]
PHPExcel_Worksheet::getCell (   $pCoordinate = 'A1')

Get cell at a specific coordinate

Parameters
string$pCoordinateCoordinate of the cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Cell Cell that was found
PHPExcel_Worksheet::getCellByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

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
PHPExcel_Worksheet::getCellCacheController ( )

Return the cache controller for the cell collection

Returns
PHPExcel_CachedObjectStorage_xxx
PHPExcel_Worksheet::getCellCollection (   $pSorted = true)

Get collection of cells

Parameters
boolean$pSortedAlso sort the cell collection?
Returns
PHPExcel_Cell[]
PHPExcel_Worksheet::getChartByIndex (   $index = null)

Get a chart by its index position

Parameters
string$indexChart index position
Returns
false|PHPExcel_Chart
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::getChartByName (   $chartName = '')

Get a chart by name

Parameters
string$chartNameChart name
Returns
false|PHPExcel_Chart
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::getChartCollection ( )

Get collection of charts

Returns
PHPExcel_Chart[]
PHPExcel_Worksheet::getChartCount ( )

Return the count of charts on this worksheet

Returns
int The number of charts
PHPExcel_Worksheet::getChartNames ( )

Return an array of the names of charts on this worksheet

Returns
string[] The names of charts
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::getCodeName ( )

Return the code name of the sheet

Returns
null|string
PHPExcel_Worksheet::getColumnDimension (   $pColumn = 'A',
  $create = TRUE 
)

Get column dimension at a specific column

Parameters
string$pColumnString index of the column
Returns
PHPExcel_Worksheet_ColumnDimension
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
Returns
PHPExcel_Worksheet_ColumnDimension
PHPExcel_Worksheet::getColumnDimensions ( )

Get collection of column dimensions

Returns
PHPExcel_Worksheet_ColumnDimension[]
PHPExcel_Worksheet::getComment (   $pCellCoordinate = 'A1')

Get comment for cell

Parameters
string$pCellCoordinateCell coordinate to get comment for
Returns
PHPExcel_Comment
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::getCommentByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

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
PHPExcel_Worksheet::getComments ( )

Get comments

Returns
PHPExcel_Comment[]
PHPExcel_Worksheet::getConditionalStyles (   $pCoordinate = 'A1')

Get conditional styles for a cell

Parameters
string$pCoordinate
Returns
PHPExcel_Style_Conditional[]
PHPExcel_Worksheet::getConditionalStylesCollection ( )

Get collection of conditional styles

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

Get data validation

Parameters
string$pCellCoordinateCell coordinate to get data validation for
PHPExcel_Worksheet::getDataValidationCollection ( )

Get collection of data validations

Returns
PHPExcel_Cell_DataValidation[]
PHPExcel_Worksheet::getDefaultColumnDimension ( )

Get default column dimension

Returns
PHPExcel_Worksheet_ColumnDimension
PHPExcel_Worksheet::getDefaultRowDimension ( )

Get default row dimension

Returns
PHPExcel_Worksheet_RowDimension
PHPExcel_Worksheet::getDefaultStyle ( )

Get default style of workbook.

Deprecated:
Returns
PHPExcel_Style
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::getDrawingCollection ( )

Get collection of drawings

Returns
PHPExcel_Worksheet_BaseDrawing[]
PHPExcel_Worksheet::getFreezePane ( )

Get Freeze Pane

Returns
string
PHPExcel_Worksheet::getHashCode ( )

Get hash code

Returns
string Hash code

Implements PHPExcel_IComparable.

PHPExcel_Worksheet::getHeaderFooter ( )

Get page header/footer

Returns
PHPExcel_Worksheet_HeaderFooter
PHPExcel_Worksheet::getHighestColumn (   $row = null)

Get highest worksheet column

Parameters
string$rowReturn 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
PHPExcel_Worksheet::getHighestDataColumn (   $row = null)

Get highest worksheet column that contains data

Parameters
string$rowReturn 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
PHPExcel_Worksheet::getHighestDataRow (   $column = null)

Get highest worksheet row that contains data

Parameters
string$columnReturn 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
PHPExcel_Worksheet::getHighestRow (   $column = null)

Get highest worksheet row

Parameters
string$columnReturn the highest data row for the specified column, or the highest row of any column if no column letter is passed
Returns
int Highest row number
PHPExcel_Worksheet::getHighestRowAndColumn ( )

Get highest worksheet column and highest row that have cell records

Returns
array Highest column name and highest row number
PHPExcel_Worksheet::getHyperlink (   $pCellCoordinate = 'A1')

Get hyperlink

Parameters
string$pCellCoordinateCell coordinate to get hyperlink for
PHPExcel_Worksheet::getHyperlinkCollection ( )

Get collection of hyperlinks

Returns
PHPExcel_Cell_Hyperlink[]
static PHPExcel_Worksheet::getInvalidCharacters ( )
static

Get array of invalid characters for sheet title

Returns
array
PHPExcel_Worksheet::getMergeCells ( )

Get merge cells array.

Returns
array[]
PHPExcel_Worksheet::getPageMargins ( )

Get page margins

Returns
PHPExcel_Worksheet_PageMargins
PHPExcel_Worksheet::getPageSetup ( )

Get page setup

Returns
PHPExcel_Worksheet_PageSetup
PHPExcel_Worksheet::getParent ( )

Get parent

Returns
PHPExcel
PHPExcel_Worksheet::getPrintGridlines ( )

Print gridlines?

Returns
boolean
PHPExcel_Worksheet::getProtectedCells ( )

Get protected cells

Returns
array[]
PHPExcel_Worksheet::getProtection ( )

Get Protection

Returns
PHPExcel_Worksheet_Protection
PHPExcel_Worksheet::getRightToLeft ( )

Get right-to-left

Returns
boolean
PHPExcel_Worksheet::getRowDimension (   $pRow = 1,
  $create = TRUE 
)

Get row dimension at a specific row

Parameters
int$pRowNumeric index of the row
Returns
PHPExcel_Worksheet_RowDimension
PHPExcel_Worksheet::getRowDimensions ( )

Get collection of row dimensions

Returns
PHPExcel_Worksheet_RowDimension[]
PHPExcel_Worksheet::getRowIterator (   $startRow = 1)

Get row iterator

Parameters
integer$startRowThe row number at which to start iterating
Returns
PHPExcel_Worksheet_RowIterator
PHPExcel_Worksheet::getSelectedCell ( )

Get selected cell

Deprecated:
Returns
string
PHPExcel_Worksheet::getSelectedCells ( )

Get selected cells

Returns
string
PHPExcel_Worksheet::getSheetState ( )

Get sheet state

Returns
string Sheet state (visible, hidden, veryHidden)
PHPExcel_Worksheet::getSheetView ( )

Get sheet view

Returns
PHPExcel_Worksheet_SheetView
PHPExcel_Worksheet::getShowGridlines ( )

Show gridlines?

Returns
boolean
PHPExcel_Worksheet::getShowRowColHeaders ( )

Show row and column headers?

Returns
boolean
PHPExcel_Worksheet::getShowSummaryBelow ( )

Show summary below? (Row/Column outlining)

Returns
boolean
PHPExcel_Worksheet::getShowSummaryRight ( )

Show summary right? (Row/Column outlining)

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

Get style for cell

Parameters
string$pCellCoordinateCell coordinate to get style for
Returns
PHPExcel_Style
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::getStyleByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

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
PHPExcel_Worksheet::getStyles ( )

Get styles

Returns
PHPExcel_Style[]
PHPExcel_Worksheet::getTabColor ( )

Get tab color

Returns
PHPExcel_Style_Color
PHPExcel_Worksheet::getTitle ( )

Get title

Returns
string
PHPExcel_Worksheet::hasCodeName ( )

Sheet has a code name ?

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

Hyperlink at a specific coordinate exists?

Parameters
string$pCoordinate
Returns
boolean
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::isTabColorSet ( )

Tab color set?

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

Set merge on a cell range

Parameters
string$pRangeCell range (e.g. A1:E1)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::mergeCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1 
)

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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::namedRangeToArray (   $pNamedRange = '',
  $nullValue = null,
  $calculateFormulas = true,
  $formatData = true,
  $returnCellRef = false 
)

Create array from a range of cells

Parameters
string$pNamedRangeName of the Named Range
mixed$nullValueValue returned in the array entry if a cell doesn't exist
boolean$calculateFormulasShould formulas be calculated?
boolean$formatDataShould formatting be applied to cell values?
boolean$returnCellRefFalse - 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
Exceptions
PHPExcel_Exception
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::protectCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1,
  $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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::rangeToArray (   $pRange = 'A1',
  $nullValue = null,
  $calculateFormulas = true,
  $formatData = true,
  $returnCellRef = false 
)

Create array from a range of cells

Parameters
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
mixed$nullValueValue returned in the array entry if a cell doesn't exist
boolean$calculateFormulasShould formulas be calculated?
boolean$formatDataShould formatting be applied to cell values?
boolean$returnCellRefFalse - 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
PHPExcel_Worksheet::rebindParent ( PHPExcel  $parent)

Re-bind parent

Parameters
PHPExcel$parent
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::refreshColumnDimensions ( )

Refresh column dimensions

Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::refreshRowDimensions ( )

Refresh row dimensions

Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::removeAutoFilter ( )

Remove autofilter

Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::removeConditionalStyles (   $pCoordinate = 'A1')

Removes conditional styles for a cell

Parameters
string$pCoordinate
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::resetTabColor ( )

Reset tab color

Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setAutoFilter (   $pValue)

Set AutoFilter

Parameters
PHPExcel_Worksheet_AutoFilter | string$pValueA simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setAutoFilterByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1 
)

Set Autofilter Range by using numeric cell coordinates

Parameters
integer$pColumn1Numeric column coordinate of the first cell
integer$pRow1Numeric row coordinate of the first cell
integer$pColumn2Numeric column coordinate of the second cell
integer$pRow2Numeric row coordinate of the second cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setBreakByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pBreak = PHPExcel_Worksheet::BREAK_NONE 
)

Set break on a cell by using numeric cell coordinates

Parameters
integer$pColumnNumeric column coordinate of the cell
integer$pRowNumeric row coordinate of the cell
integer$pBreakBreak type (type of PHPExcel_Worksheet::BREAK_*)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setCellValue (   $pCoordinate = 'A1',
  $pValue = null,
  $returnCell = false 
)

Set a cell value

Parameters
string$pCoordinateCoordinate of the cell
mixed$pValueValue of the cell
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
PHPExcel_Worksheet::setCellValueByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pValue = null,
  $returnCell = false 
)

Set a cell value by using numeric cell coordinates

Parameters
string$pColumnNumeric column coordinate of the cell (A = 0)
string$pRowNumeric row coordinate of the cell
mixed$pValueValue of the cell
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
PHPExcel_Worksheet::setCellValueExplicit (   $pCoordinate = 'A1',
  $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING,
  $returnCell = false 
)

Set a cell value

Parameters
string$pCoordinateCoordinate of the cell
mixed$pValueValue of the cell
string$pDataTypeExplicit data type
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
PHPExcel_Worksheet::setCellValueExplicitByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING,
  $returnCell = false 
)

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
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
PHPExcel_Worksheet::setCodeName (   $pValue = null)

Define the code name of the sheet

Parameters
null|stringSame rule as Title minus space not allowed (but, like Excel, change silently space to underscore)
Returns
objWorksheet
Exceptions
PHPExcel_Exception
PHPExcel_Worksheet::setComments (   $pValue = array())

Set comments array for the entire sheet.

Parameters
arrayof PHPExcel_Comment
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setConditionalStyles (   $pCoordinate = 'A1',
  $pValue 
)

Set conditional styles

Parameters
$pCoordinatestring E.g. 'A1'
$pValuePHPExcel_Style_Conditional[]
Returns
PHPExcel_Worksheet
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
PHPExcel_Worksheet::setDefaultStyle ( PHPExcel_Style  $pValue)

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

Deprecated:
Parameters
PHPExcel_Style$pValue
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setHeaderFooter ( PHPExcel_Worksheet_HeaderFooter  $pValue)

Set page header/footer

Parameters
PHPExcel_Worksheet_HeaderFooter$pValue
Returns
PHPExcel_Worksheet
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
PHPExcel_Worksheet::setMergeCells (   $pValue = array())

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

Parameters
array
PHPExcel_Worksheet::setPageMargins ( PHPExcel_Worksheet_PageMargins  $pValue)

Set page margins

Parameters
PHPExcel_Worksheet_PageMargins$pValue
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setPageSetup ( PHPExcel_Worksheet_PageSetup  $pValue)

Set page setup

Parameters
PHPExcel_Worksheet_PageSetup$pValue
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setPrintGridlines (   $pValue = false)

Set print gridlines

Parameters
boolean$pValuePrint gridlines (true/false)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setProtection ( PHPExcel_Worksheet_Protection  $pValue)

Set Protection

Parameters
PHPExcel_Worksheet_Protection$pValue
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setRightToLeft (   $value = false)

Set right-to-left

Parameters
boolean$valueRight-to-left true/false
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setSelectedCell (   $pCoordinate = 'A1')

Selected cell

Parameters
string$pCoordinateCell (i.e. A1)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setSelectedCellByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Selected cell by using numeric cell coordinates

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setSelectedCells (   $pCoordinate = 'A1')

Select a range of cells.

Parameters
string$pCoordinateCell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setSheetState (   $value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE)

Set sheet state

Parameters
string$valueSheet state (visible, hidden, veryHidden)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setSheetView ( PHPExcel_Worksheet_SheetView  $pValue)

Set sheet view

Parameters
PHPExcel_Worksheet_SheetView$pValue
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setShowGridlines (   $pValue = false)

Set show gridlines

Parameters
boolean$pValueShow gridlines (true/false)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setShowRowColHeaders (   $pValue = false)

Set show row and column headers

Parameters
boolean$pValueShow row and column headers (true/false)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setShowSummaryBelow (   $pValue = true)

Set show summary below

Parameters
boolean$pValueShow summary below (true/false)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setShowSummaryRight (   $pValue = true)

Set show summary right

Parameters
boolean$pValueShow summary right (true/false)
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::setTitle (   $pValue = 'Worksheet',
  $updateFormulaCellReferences = true 
)

Set title

Parameters
string$pValueString containing the dimension of this worksheet
string$updateFormulaCellReferencesboolean 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
PHPExcel_Worksheet::shrinkRangeToFit (   $range)

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

Parameters
string$range
Returns
string Adjusted range value
PHPExcel_Worksheet::sortCellCollection ( )

Sort collection of cells

Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::toArray (   $nullValue = null,
  $calculateFormulas = true,
  $formatData = true,
  $returnCellRef = false 
)

Create array from worksheet

Parameters
mixed$nullValueValue returned in the array entry if a cell doesn't exist
boolean$calculateFormulasShould formulas be calculated?
boolean$formatDataShould formatting be applied to cell values?
boolean$returnCellRefFalse - 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
PHPExcel_Worksheet::unfreezePane ( )

Unfreeze Pane

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

Remove merge on a cell range

Parameters
string$pRangeCell range (e.g. A1:E1)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::unmergeCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1 
)

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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
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
PHPExcel_Exception
Returns
PHPExcel_Worksheet
PHPExcel_Worksheet::unprotectCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1,
  $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
PHPExcel_Exception
Returns
PHPExcel_Worksheet

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