PHPExcel

category PHPExcel
package PHPExcel
copyright Copyright (c) 2006 - 2014 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

Remove all macros, certificate from spreadsheet

discardMacros() : void

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

Return the macros certificate

getMacrosCertificate() : \binary | null

Returns

\binarynull

Return the macros code

getMacrosCode() : \binary | null

Returns

\binarynull

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

retrieve Binaries Ribbon Objects

getRibbonBinObjects($What) 

Parameters

$What

retrieve ribbon XML Data

getRibbonXMLData($What) 

return string|null|array

Parameters

$What

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 code name.

getSheetByCodeName(string $pName) : \PHPExcel_Worksheet

Warning : sheet don't have always a code name !

Parameters

$pName

string

Sheet name

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

The workbook has macros ?

hasMacros() : true

Returns

trueif workbook has macros, false if not

Is the project signed ?

hasMacrosCertificate() : true | false

Returns

truefalse

This workbook have a custom UI ?

hasRibbon() : true | false

Returns

truefalse

This workbook have additionnal object for the ribbon ?

hasRibbonBinObjects() : true | false

Returns

truefalse

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

Define if a workbook has macros

setHasMacros(true | false $hasMacros) 

Parameters

$hasMacros

truefalse

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 the macros certificate

setMacrosCertificate(\binary | null $Certificate) 

Parameters

$Certificate

\binarynull

Set the macros code

setMacrosCode(\binary $MacrosCode) 

Parameters

$MacrosCode

\binary

string|null

Set properties

setProperties(\PHPExcel_DocumentProperties $pValue) 

Parameters

store binaries ribbon objects (pictures)

setRibbonBinObjects($BinObjectsNames, $BinObjectsData) 

Parameters

$BinObjectsNames

$BinObjectsData

set ribbon XML data

setRibbonXMLData($Target, $XMLData) 

Parameters

$Target

$XMLData

Set security

setSecurity(\PHPExcel_DocumentSecurity $pValue) 

Parameters

Check if a sheet with a specified code name already exists

sheetCodeNameExists(string $pSheetCodeName) : boolean

Parameters

$pSheetCodeName

string

Name of the worksheet to check

Returns

boolean

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

return the extension of a filename.

_getExtensionOnly($ThePath) 

Internal use for a array_map callback (php<5.3 don't like lambda function)

Parameters

$ThePath

 Properties

 

$_activeSheetIndex : int
 

$_calculationEngine : \PHPExcel_Calculation
 

$_cellStyleXfCollection : \PHPExcel_Style[]
 

$_cellXfCollection : \PHPExcel_Style[]
 

$_cellXfSupervisor : \PHPExcel_Style
 

$_hasMacros : bool
 

$_macrosCertificate : \binary
 

$_macrosCode : \binary
 

$_namedRanges : \PHPExcel_NamedRange[]
 

$_properties : \PHPExcel_DocumentProperties
 

$_ribbonBinObjects : NULL | array
 

$_ribbonXMLData : NULL | string
   

$_uniqueID : string
 

$_workSheetCollection : \PHPExcel_Worksheet[]