PHPExcel

category PHPExcel
package PHPExcel
copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)

 Methods

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

__clone() 

Create a new PHPExcel with one Worksheet

__construct() 

Code to execute when this worksheet is unset()

__destruct() 

Add a cellStyleXf to the workbook

addCellStyleXf(\PHPExcel_Style $pStyle) 

Parameters

$pStyle

\PHPExcel_Style

Add a cellXf to the workbook

addCellXf(\PHPExcel_Style $style) 

Parameters

Add external sheet

addExternalSheet(\PHPExcel_Worksheet $pSheet, int | null $iSheetIndex) : \PHPExcel_Worksheet

Parameters

$pSheet

\PHPExcel_Worksheet

External sheet to add

$iSheetIndex

intnull

Index where sheet should go (0,1,..., or null for last)

Exceptions

\PHPExcel_Exception

Returns

Add named range

addNamedRange(\PHPExcel_NamedRange $namedRange) : \PHPExcel

Parameters

$namedRange

\PHPExcel_NamedRange

Returns

Add sheet

addSheet(\PHPExcel_Worksheet $pSheet, int | null $iSheetIndex) : \PHPExcel_Worksheet

Parameters

$iSheetIndex

intnull

Index where sheet should go (0,1,..., or null for last)

Exceptions

\PHPExcel_Exception

Returns

Check if style exists in style collection

cellXfExists(\PHPExcel_Style $pCellStyle) : boolean

Parameters

$pCellStyle

\PHPExcel_Style

Returns

boolean

Copy workbook (!= clone!)

copy() : \PHPExcel

Returns

Create sheet and add it to this workbook

createSheet(int | null $iSheetIndex) : \PHPExcel_Worksheet

Parameters

$iSheetIndex

intnull

Index where sheet should go (0,1,..., or null for last)

Exceptions

\PHPExcel_Exception

Returns

Disconnect all worksheets from this PHPExcel workbook object, typically so that the PHPExcel object can be unset

disconnectWorksheets() 

Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells and columns in the workbook

garbageCollect() 

Get active sheet

getActiveSheet() : \PHPExcel_Worksheet

Get active sheet index

getActiveSheetIndex() : int

Returns

intActive sheet index

Get all sheets

getAllSheets() : \PHPExcel_Worksheet[]

Return the calculation engine for this worksheet

getCalculationEngine() : \PHPExcel_Calculation

Get cellStyleXf by hash code

getCellStyleXfByHashCode(string $pValue) : \PHPExcel_Style | false

Parameters

$pValue

string

Returns

Get cellStyleXf by index

getCellStyleXfByIndex(int $pIndex) : \PHPExcel_Style

Parameters

$pIndex

int

Returns

Get the workbook collection of cellStyleXfs

getCellStyleXfCollection() : \PHPExcel_Style[]

Get cellXf by hash code

getCellXfByHashCode(string $pValue) : \PHPExcel_Style | false

Parameters

$pValue

string

Returns

Get cellXf by index

getCellXfByIndex(int $pIndex) : \PHPExcel_Style

Parameters

$pIndex

int

Returns

Get the workbook collection of cellXfs

getCellXfCollection() : \PHPExcel_Style[]

Get the cellXf supervisor

getCellXfSupervisor() : \PHPExcel_Style

Returns

Get default style

getDefaultStyle() : \PHPExcel_Style

Return the unique ID value assigned to this spreadsheet workbook

getID() : string

Returns

string

Get index for sheet

getIndex(\PHPExcel_Worksheet $pSheet) : \Sheet

Parameters

Exceptions

\PHPExcel_Exception

Returns

\Sheetindex

Get named range

getNamedRange(string $namedRange, \PHPExcel_Worksheet $pSheet) : \PHPExcel_NamedRange | null

Parameters

$namedRange

string

$pSheet

\PHPExcel_Worksheetnull

Scope. Use null for global scope

Returns

Get named ranges

getNamedRanges() : \PHPExcel_NamedRange[]

Get properties

getProperties() : \PHPExcel_DocumentProperties

Get security

getSecurity() : \PHPExcel_DocumentSecurity

Get sheet by index

getSheet(int $pIndex) : \PHPExcel_Worksheet

Parameters

$pIndex

int

Sheet index

Exceptions

\PHPExcel_Exception

Returns

Get sheet by name

getSheetByName(string $pName) : \PHPExcel_Worksheet

Parameters

$pName

string

Sheet name

Returns

Get sheet count

getSheetCount() : int

Returns

int

Get sheet names

getSheetNames() : string[]

Returns

string[]

Get worksheet iterator

getWorksheetIterator() : \PHPExcel_WorksheetIterator

Remove cellStyleXf by index

removeCellStyleXfByIndex(int $pIndex) 

Parameters

$pIndex

int

Exceptions

\PHPExcel_Exception

Remove cellXf by index.

removeCellXfByIndex(int $pIndex) 

It is ensured that all cells get their xf index updated.

Parameters

$pIndex

int

Index to cellXf

Exceptions

\PHPExcel_Exception

Remove named range

removeNamedRange(string $namedRange, \PHPExcel_Worksheet $pSheet) : \PHPExcel

Parameters

$namedRange

string

$pSheet

\PHPExcel_Worksheetnull

Scope: use null for global scope.

Returns

Remove sheet by index

removeSheetByIndex(int $pIndex) 

Parameters

$pIndex

int

Active sheet index

Exceptions

\PHPExcel_Exception

Set active sheet index

setActiveSheetIndex(int $pIndex) : \PHPExcel_Worksheet

Parameters

$pIndex

int

Active sheet index

Exceptions

\PHPExcel_Exception

Returns

Set active sheet index by name

setActiveSheetIndexByName(string $pValue) : \PHPExcel_Worksheet

Parameters

$pValue

string

Sheet title

Exceptions

\PHPExcel_Exception

Returns

Set index for sheet by sheet name.

setIndexByName(string $sheetName, int $newIndex) : \New

Parameters

$sheetName

string

Sheet name to modify index for

$newIndex

int

New index for the sheet

Exceptions

\PHPExcel_Exception

Returns

\Newsheet index

Set properties

setProperties(\PHPExcel_DocumentProperties $pValue) 

Parameters

Set security

setSecurity(\PHPExcel_DocumentSecurity $pValue) 

Parameters

Check if a sheet with a specified name already exists

sheetNameExists(string $pSheetName) : boolean

Parameters

$pSheetName

string

Name of the worksheet to check

Returns

boolean

 Properties

 

$_activeSheetIndex : int
 

$_calculationEngine : \PHPExcel_Calculation
 

$_cellStyleXfCollection : \PHPExcel_Style[]
 

$_cellXfCollection : \PHPExcel_Style[]
 

$_cellXfSupervisor : \PHPExcel_Style
 

$_namedRanges : \PHPExcel_NamedRange[]
 

$_properties : \PHPExcel_DocumentProperties
   

$_uniqueID : string
 

$_workSheetCollection : \PHPExcel_Worksheet[]