Spreadsheet implements JsonSerializable
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- VISIBILITY_HIDDEN = 'hidden'
- VISIBILITY_VERY_HIDDEN = 'veryHidden'
- VISIBILITY_VISIBLE = 'visible'
- DEFINED_NAME_IS_FORMULA = true
- DEFINED_NAME_IS_RANGE = false
- WORKBOOK_VIEW_VISIBILITY_VALUES = [self::VISIBILITY_VISIBLE, self::VISIBILITY_HIDDEN, self::VISIBILITY_VERY_HIDDEN]
- $activeSheetIndex : int
- Active sheet index.
- $autoFilterDateGrouping : bool
- Specifies a boolean value that indicates whether to group dates when presenting the user with filtering optiomd in the user interface.
- $calculationEngine : null|Calculation
- Calculation Engine.
- $cellStyleXfCollection : array<string|int, Style>
- CellStyleXf collection.
- $cellXfCollection : array<string|int, Style>
- CellXf collection.
- $cellXfSupervisor : Style
- CellXf supervisor.
- $definedNames : array<string|int, DefinedName>
- Named ranges.
- $firstSheetIndex : int
- Specifies the index to the first sheet in the book view.
- $hasMacros : bool
- hasMacros : this workbook have macros ?
- $macrosCertificate : null|string
- macrosCertificate : if macros are signed, contains binary data vbaProjectSignature.bin file, null if not signed.
- $macrosCode : null|string
- macrosCode : all macros code as binary data (the vbaProject.bin file, this include form, code, etc.), null if no macro.
- $minimized : bool
- Specifies a boolean value that indicates whether the workbook window is minimized.
- $properties : Properties
- Document properties.
- $ribbonBinObjects : null|array<string|int, mixed>
- ribbonBinObjects : null if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements ignored if $ribbonXMLData is null.
- $ribbonXMLData : mixed
- ribbonXMLData : null if workbook is'nt Excel 2007 or not contain a customized UI.
- $security : Security
- Document security.
- $showHorizontalScroll : bool
- Controls visibility of the horizonal scroll bar in the application.
- $showSheetTabs : bool
- Controls visibility of the sheet tabs in the application.
- $showVerticalScroll : bool
- Controls visibility of the horizonal scroll bar in the application.
- $tabRatio : int
- Specifies the ratio between the workbook tabs bar and the horizontal scroll bar. TabRatio is assumed to be out of 1000 of the horizontal window width.
- $uniqueID : string
- Unique ID.
- $unparsedLoadedData : array<string|int, mixed>
- List of unparsed loaded data for export to same format with better compatibility.
- $visibility : string
- Specifies the visible status of the workbook.
- $workSheetCollection : array<string|int, Worksheet>
- Collection of Worksheet objects.
- __clone() : mixed
- __construct() : mixed
- Create a new PhpSpreadsheet with one Worksheet.
- __destruct() : mixed
- Code to execute when this worksheet is unset().
- __serialize() : mixed
- addCellStyleXf() : void
- Add a cellStyleXf to the workbook.
- addCellXf() : void
- Add a cellXf to the workbook.
- addDefinedName() : void
- Add a defined name (either a named range or a named formula).
- addExternalSheet() : Worksheet
- Add external sheet.
- addNamedFormula() : void
- Add a named formula.
- addNamedRange() : void
- Add a named range.
- addSheet() : Worksheet
- Add sheet.
- cellXfExists() : bool
- Check if style exists in style collection.
- copy() : Spreadsheet
- Copy workbook (!= clone!).
- createSheet() : Worksheet
- Create sheet and add it to this workbook.
- discardMacros() : void
- Remove all macros, certificate from spreadsheet.
- disconnectWorksheets() : void
- Disconnect all worksheets from this PhpSpreadsheet workbook object, typically so that the PhpSpreadsheet object can be unset.
- garbageCollect() : void
- Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells and columns in the workbook.
- getActiveSheet() : Worksheet
- Get active sheet.
- getActiveSheetIndex() : int
- Get active sheet index.
- getAllSheets() : array<string|int, Worksheet>
- Get all sheets.
- getAutoFilterDateGrouping() : bool
- Return whether to group dates when presenting the user with filtering optiomd in the user interface.
- getCalculationEngine() : null|Calculation
- Return the calculation engine for this worksheet.
- getCellStyleXfByHashCode() : false|Style
- Get cellStyleXf by hash code.
- getCellStyleXfByIndex() : Style
- Get cellStyleXf by index.
- getCellStyleXfCollection() : array<string|int, Style>
- Get the workbook collection of cellStyleXfs.
- getCellXfByHashCode() : false|Style
- Get cellXf by hash code.
- getCellXfByIndex() : Style
- Get cellXf by index.
- getCellXfCollection() : array<string|int, Style>
- Get the workbook collection of cellXfs.
- getCellXfSupervisor() : Style
- Get the cellXf supervisor.
- getDefaultStyle() : Style
- Get default style.
- getDefinedName() : DefinedName|null
- Get named range.
- getDefinedNames() : array<string|int, DefinedName>
- Get an array of all Defined Names (both named ranges and named formulae).
- getFirstSheetIndex() : int
- Return the first sheet in the book view.
- getID() : string
- Return the unique ID value assigned to this spreadsheet workbook.
- getIndex() : int
- Get index for sheet.
- getMacrosCertificate() : null|string
- Return the macros certificate.
- getMacrosCode() : null|string
- Return the macros code.
- getMinimized() : bool
- Return whether the workbook window is minimized.
- getNamedFormula() : NamedFormula|null
- Get named formula.
- getNamedFormulae() : array<string|int, DefinedName>
- Get an array of all Named Formulae.
- getNamedRange() : NamedRange|null
- Get named range.
- getNamedRanges() : array<string|int, DefinedName>
- Get an array of all Named Ranges.
- getProperties() : Properties
- Get properties.
- getRibbonBinObjects() : null|array<string|int, mixed>
- retrieve Binaries Ribbon Objects.
- getRibbonXMLData() : null|array<string|int, mixed>|string
- retrieve ribbon XML Data.
- getSecurity() : Security
- Get security.
- getSharedComponent() : Style
- Silliness to mollify Scrutinizer.
- getSheet() : Worksheet
- Get sheet by index.
- getSheetByCodeName() : null|Worksheet
- Get sheet by code name. Warning : sheet don't have always a code name !
- getSheetByName() : null|Worksheet
- Get sheet by name.
- getSheetByNameOrThrow() : Worksheet
- Get sheet by name, throwing exception if not found.
- getSheetCount() : int
- Get sheet count.
- getSheetNames() : array<string|int, string>
- Get sheet names.
- getShowHorizontalScroll() : bool
- Get the visibility of the horizonal scroll bar in the application.
- getShowSheetTabs() : bool
- Get the visibility of the sheet tabs in the application.
- getShowVerticalScroll() : bool
- Get the visibility of the vertical scroll bar in the application.
- getTabRatio() : int
- Get the ratio between the workbook tabs bar and the horizontal scroll bar.
- getVisibility() : string
- Return the visibility status of the workbook.
- getWorksheetIterator() : Iterator
- Get worksheet iterator.
- hasMacros() : bool
- The workbook has macros ?
- hasMacrosCertificate() : bool
- Is the project signed ?
- hasRibbon() : bool
- This workbook have a custom UI ?
- hasRibbonBinObjects() : bool
- This workbook have additionnal object for the ribbon ?
- jsonSerialize() : mixed
- reevaluateAutoFilters() : void
- removeCellStyleXfByIndex() : void
- Remove cellStyleXf by index.
- removeCellXfByIndex() : void
- Remove cellXf by index. It is ensured that all cells get their xf index updated.
- removeDefinedName() : $this
- Remove defined name.
- removeNamedFormula() : $this
- Remove named formula.
- removeNamedRange() : $this
- Remove named range.
- removeSheetByIndex() : void
- Remove sheet by index.
- setActiveSheetIndex() : Worksheet
- Set active sheet index.
- setActiveSheetIndexByName() : Worksheet
- Set active sheet index by name.
- setAutoFilterDateGrouping() : void
- Set whether to group dates when presenting the user with filtering optiomd in the user interface.
- setFirstSheetIndex() : void
- Set the first sheet in the book view.
- setHasMacros() : void
- Define if a workbook has macros.
- setIndexByName() : int
- Set index for sheet by sheet name.
- setMacrosCertificate() : void
- Set the macros certificate.
- setMacrosCode() : void
- Set the macros code.
- setMinimized() : void
- Set whether the workbook window is minimized.
- setProperties() : void
- Set properties.
- setRibbonBinObjects() : void
- store binaries ribbon objects (pictures).
- setRibbonXMLData() : void
- set ribbon XML data.
- setSecurity() : void
- Set security.
- setShowHorizontalScroll() : void
- Set the visibility of the horizonal scroll bar in the application.
- setShowSheetTabs() : void
- Set the visibility of the sheet tabs in the application.
- setShowVerticalScroll() : void
- Set the visibility of the vertical scroll bar in the application.
- setTabRatio() : void
- Set the ratio between the workbook tabs bar and the horizontal scroll bar TabRatio is assumed to be out of 1000 of the horizontal window width.
- setVisibility() : void
- Set the visibility status of the workbook.
- sheetCodeNameExists() : bool
- Check if a sheet with a specified code name already exists.
- sheetNameExists() : bool
- Check if a sheet with a specified name already exists.
- getExtensionOnly() : string
- return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function).
- getGlobalDefinedNameByType() : DefinedName|null
- getLocalDefinedNameByType() : DefinedName|null
Constants
VISIBILITY_HIDDEN
public
mixed
VISIBILITY_HIDDEN
= 'hidden'
VISIBILITY_VERY_HIDDEN
public
mixed
VISIBILITY_VERY_HIDDEN
= 'veryHidden'
VISIBILITY_VISIBLE
public
mixed
VISIBILITY_VISIBLE
= 'visible'
DEFINED_NAME_IS_FORMULA
private
mixed
DEFINED_NAME_IS_FORMULA
= true
DEFINED_NAME_IS_RANGE
private
mixed
DEFINED_NAME_IS_RANGE
= false
WORKBOOK_VIEW_VISIBILITY_VALUES
private
mixed
WORKBOOK_VIEW_VISIBILITY_VALUES
= [self::VISIBILITY_VISIBLE, self::VISIBILITY_HIDDEN, self::VISIBILITY_VERY_HIDDEN]
Properties
$activeSheetIndex
Active sheet index.
private
int
$activeSheetIndex
= 0
$autoFilterDateGrouping
Specifies a boolean value that indicates whether to group dates when presenting the user with filtering optiomd in the user interface.
private
bool
$autoFilterDateGrouping
= true
$calculationEngine
Calculation Engine.
private
null|Calculation
$calculationEngine
$cellStyleXfCollection
CellStyleXf collection.
private
array<string|int, Style>
$cellStyleXfCollection
= []
$cellXfCollection
CellXf collection.
private
array<string|int, Style>
$cellXfCollection
= []
$cellXfSupervisor
CellXf supervisor.
private
Style
$cellXfSupervisor
$definedNames
Named ranges.
private
array<string|int, DefinedName>
$definedNames
= []
$firstSheetIndex
Specifies the index to the first sheet in the book view.
private
int
$firstSheetIndex
= 0
$hasMacros
hasMacros : this workbook have macros ?
private
bool
$hasMacros
= false
$macrosCertificate
macrosCertificate : if macros are signed, contains binary data vbaProjectSignature.bin file, null if not signed.
private
null|string
$macrosCertificate
$macrosCode
macrosCode : all macros code as binary data (the vbaProject.bin file, this include form, code, etc.), null if no macro.
private
null|string
$macrosCode
$minimized
Specifies a boolean value that indicates whether the workbook window is minimized.
private
bool
$minimized
= false
$properties
Document properties.
private
Properties
$properties
$ribbonBinObjects
ribbonBinObjects : null if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements ignored if $ribbonXMLData is null.
private
null|array<string|int, mixed>
$ribbonBinObjects
$ribbonXMLData
ribbonXMLData : null if workbook is'nt Excel 2007 or not contain a customized UI.
private
mixed
$ribbonXMLData
$security
Document security.
private
Security
$security
$showHorizontalScroll
Controls visibility of the horizonal scroll bar in the application.
private
bool
$showHorizontalScroll
= true
$showSheetTabs
Controls visibility of the sheet tabs in the application.
private
bool
$showSheetTabs
= true
$showVerticalScroll
Controls visibility of the horizonal scroll bar in the application.
private
bool
$showVerticalScroll
= true
$tabRatio
Specifies the ratio between the workbook tabs bar and the horizontal scroll bar. TabRatio is assumed to be out of 1000 of the horizontal window width.
private
int
$tabRatio
= 600
$uniqueID
Unique ID.
private
string
$uniqueID
$unparsedLoadedData
List of unparsed loaded data for export to same format with better compatibility.
private
array<string|int, mixed>
$unparsedLoadedData
= []
It has to be minimized when the library start to support currently unparsed data.
$visibility
Specifies the visible status of the workbook.
private
string
$visibility
= self::VISIBILITY_VISIBLE
$workSheetCollection
Collection of Worksheet objects.
private
array<string|int, Worksheet>
$workSheetCollection
= []
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__construct()
Create a new PhpSpreadsheet with one Worksheet.
public
__construct() : mixed
Return values
mixed —__destruct()
Code to execute when this worksheet is unset().
public
__destruct() : mixed
Return values
mixed —__serialize()
public
__serialize() : mixed
Tags
Return values
mixed —addCellStyleXf()
Add a cellStyleXf to the workbook.
public
addCellStyleXf(Style $style) : void
Parameters
- $style : Style
Return values
void —addCellXf()
Add a cellXf to the workbook.
public
addCellXf(Style $style) : void
Parameters
- $style : Style
Return values
void —addDefinedName()
Add a defined name (either a named range or a named formula).
public
addDefinedName(DefinedName $definedName) : void
If a defined named with this name already exists, then this will replace the existing value.
Parameters
- $definedName : DefinedName
Return values
void —addExternalSheet()
Add external sheet.
public
addExternalSheet(Worksheet $worksheet[, null|int $sheetIndex = null ]) : Worksheet
Parameters
- $worksheet : Worksheet
-
External sheet to add
- $sheetIndex : null|int = null
-
Index where sheet should go (0,1,..., or null for last)
Return values
Worksheet —addNamedFormula()
Add a named formula.
public
addNamedFormula(NamedFormula $namedFormula) : void
If a named formula with this name already exists, then this will replace the existing value.
Parameters
- $namedFormula : NamedFormula
Return values
void —addNamedRange()
Add a named range.
public
addNamedRange(NamedRange $namedRange) : void
If a named range with this name already exists, then this will replace the existing value.
Parameters
- $namedRange : NamedRange
Return values
void —addSheet()
Add sheet.
public
addSheet(Worksheet $worksheet[, null|int $sheetIndex = null ]) : Worksheet
Parameters
- $worksheet : Worksheet
-
The worksheet to add
- $sheetIndex : null|int = null
-
Index where sheet should go (0,1,..., or null for last)
Return values
Worksheet —cellXfExists()
Check if style exists in style collection.
public
cellXfExists(Style $cellStyleIndex) : bool
Parameters
- $cellStyleIndex : Style
Return values
bool —copy()
Copy workbook (!= clone!).
public
copy() : Spreadsheet
Return values
Spreadsheet —createSheet()
Create sheet and add it to this workbook.
public
createSheet([null|int $sheetIndex = null ]) : Worksheet
Parameters
- $sheetIndex : null|int = null
-
Index where sheet should go (0,1,..., or null for last)
Return values
Worksheet —discardMacros()
Remove all macros, certificate from spreadsheet.
public
discardMacros() : void
Return values
void —disconnectWorksheets()
Disconnect all worksheets from this PhpSpreadsheet workbook object, typically so that the PhpSpreadsheet object can be unset.
public
disconnectWorksheets() : void
Return values
void —garbageCollect()
Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells and columns in the workbook.
public
garbageCollect() : void
Return values
void —getActiveSheet()
Get active sheet.
public
getActiveSheet() : Worksheet
Return values
Worksheet —getActiveSheetIndex()
Get active sheet index.
public
getActiveSheetIndex() : int
Return values
int —Active sheet index
getAllSheets()
Get all sheets.
public
getAllSheets() : array<string|int, Worksheet>
Return values
array<string|int, Worksheet> —getAutoFilterDateGrouping()
Return whether to group dates when presenting the user with filtering optiomd in the user interface.
public
getAutoFilterDateGrouping() : bool
Return values
bool —true if workbook window is minimized
getCalculationEngine()
Return the calculation engine for this worksheet.
public
getCalculationEngine() : null|Calculation
Return values
null|Calculation —getCellStyleXfByHashCode()
Get cellStyleXf by hash code.
public
getCellStyleXfByHashCode(string $hashcode) : false|Style
Parameters
- $hashcode : string
Return values
false|Style —getCellStyleXfByIndex()
Get cellStyleXf by index.
public
getCellStyleXfByIndex(int $cellStyleIndex) : Style
Parameters
- $cellStyleIndex : int
-
Index to cellXf
Return values
Style —getCellStyleXfCollection()
Get the workbook collection of cellStyleXfs.
public
getCellStyleXfCollection() : array<string|int, Style>
Return values
array<string|int, Style> —getCellXfByHashCode()
Get cellXf by hash code.
public
getCellXfByHashCode(string $hashcode) : false|Style
Parameters
- $hashcode : string
Return values
false|Style —getCellXfByIndex()
Get cellXf by index.
public
getCellXfByIndex(int $cellStyleIndex) : Style
Parameters
- $cellStyleIndex : int
Return values
Style —getCellXfCollection()
Get the workbook collection of cellXfs.
public
getCellXfCollection() : array<string|int, Style>
Return values
array<string|int, Style> —getCellXfSupervisor()
Get the cellXf supervisor.
public
getCellXfSupervisor() : Style
Return values
Style —getDefaultStyle()
Get default style.
public
getDefaultStyle() : Style
Return values
Style —getDefinedName()
Get named range.
public
getDefinedName(string $definedName[, null|Worksheet $worksheet = null ]) : DefinedName|null
Parameters
- $definedName : string
- $worksheet : null|Worksheet = null
-
Scope. Use null for global scope
Return values
DefinedName|null —getDefinedNames()
Get an array of all Defined Names (both named ranges and named formulae).
public
getDefinedNames() : array<string|int, DefinedName>
Return values
array<string|int, DefinedName> —getFirstSheetIndex()
Return the first sheet in the book view.
public
getFirstSheetIndex() : int
Return values
int —First sheet in book view
getID()
Return the unique ID value assigned to this spreadsheet workbook.
public
getID() : string
Return values
string —getIndex()
Get index for sheet.
public
getIndex(Worksheet $worksheet) : int
Parameters
- $worksheet : Worksheet
Return values
int —index
getMacrosCertificate()
Return the macros certificate.
public
getMacrosCertificate() : null|string
Return values
null|string —getMacrosCode()
Return the macros code.
public
getMacrosCode() : null|string
Return values
null|string —getMinimized()
Return whether the workbook window is minimized.
public
getMinimized() : bool
Return values
bool —true if workbook window is minimized
getNamedFormula()
Get named formula.
public
getNamedFormula(string $namedFormula[, null|Worksheet $worksheet = null ]) : NamedFormula|null
Parameters
- $namedFormula : string
- $worksheet : null|Worksheet = null
-
Scope. Use null for global scope
Return values
NamedFormula|null —getNamedFormulae()
Get an array of all Named Formulae.
public
getNamedFormulae() : array<string|int, DefinedName>
Return values
array<string|int, DefinedName> —getNamedRange()
Get named range.
public
getNamedRange(string $namedRange[, null|Worksheet $worksheet = null ]) : NamedRange|null
Parameters
- $namedRange : string
- $worksheet : null|Worksheet = null
-
Scope. Use null for global scope
Return values
NamedRange|null —getNamedRanges()
Get an array of all Named Ranges.
public
getNamedRanges() : array<string|int, DefinedName>
Return values
array<string|int, DefinedName> —getProperties()
Get properties.
public
getProperties() : Properties
Return values
Properties —getRibbonBinObjects()
retrieve Binaries Ribbon Objects.
public
getRibbonBinObjects([string $what = 'all' ]) : null|array<string|int, mixed>
Parameters
- $what : string = 'all'
Return values
null|array<string|int, mixed> —getRibbonXMLData()
retrieve ribbon XML Data.
public
getRibbonXMLData([string $what = 'all' ]) : null|array<string|int, mixed>|string
Parameters
- $what : string = 'all'
Return values
null|array<string|int, mixed>|string —getSecurity()
Get security.
public
getSecurity() : Security
Return values
Security —getSharedComponent()
Silliness to mollify Scrutinizer.
public
getSharedComponent() : Style
Tags
Return values
Style —getSheet()
Get sheet by index.
public
getSheet(int $sheetIndex) : Worksheet
Parameters
- $sheetIndex : int
-
Sheet index
Return values
Worksheet —getSheetByCodeName()
Get sheet by code name. Warning : sheet don't have always a code name !
public
getSheetByCodeName(string $codeName) : null|Worksheet
Parameters
- $codeName : string
-
Sheet name
Return values
null|Worksheet —getSheetByName()
Get sheet by name.
public
getSheetByName(string $worksheetName) : null|Worksheet
Parameters
- $worksheetName : string
-
Sheet name
Return values
null|Worksheet —getSheetByNameOrThrow()
Get sheet by name, throwing exception if not found.
public
getSheetByNameOrThrow(string $worksheetName) : Worksheet
Parameters
- $worksheetName : string
Return values
Worksheet —getSheetCount()
Get sheet count.
public
getSheetCount() : int
Return values
int —getSheetNames()
Get sheet names.
public
getSheetNames() : array<string|int, string>
Return values
array<string|int, string> —getShowHorizontalScroll()
Get the visibility of the horizonal scroll bar in the application.
public
getShowHorizontalScroll() : bool
Return values
bool —True if horizonal scroll bar is visible
getShowSheetTabs()
Get the visibility of the sheet tabs in the application.
public
getShowSheetTabs() : bool
Return values
bool —True if the sheet tabs are visible
getShowVerticalScroll()
Get the visibility of the vertical scroll bar in the application.
public
getShowVerticalScroll() : bool
Return values
bool —True if vertical scroll bar is visible
getTabRatio()
Get the ratio between the workbook tabs bar and the horizontal scroll bar.
public
getTabRatio() : int
TabRatio is assumed to be out of 1000 of the horizontal window width.
Return values
int —Ratio between the workbook tabs bar and the horizontal scroll bar
getVisibility()
Return the visibility status of the workbook.
public
getVisibility() : string
This may be one of the following three values:
- visibile
Return values
string —Visible status
getWorksheetIterator()
Get worksheet iterator.
public
getWorksheetIterator() : Iterator
Return values
Iterator —hasMacros()
The workbook has macros ?
public
hasMacros() : bool
Return values
bool —hasMacrosCertificate()
Is the project signed ?
public
hasMacrosCertificate() : bool
Return values
bool —true|false
hasRibbon()
This workbook have a custom UI ?
public
hasRibbon() : bool
Return values
bool —hasRibbonBinObjects()
This workbook have additionnal object for the ribbon ?
public
hasRibbonBinObjects() : bool
Return values
bool —jsonSerialize()
public
jsonSerialize() : mixed
Tags
Return values
mixed —reevaluateAutoFilters()
public
reevaluateAutoFilters(bool $resetToMax) : void
Parameters
- $resetToMax : bool
Return values
void —removeCellStyleXfByIndex()
Remove cellStyleXf by index.
public
removeCellStyleXfByIndex(int $cellStyleIndex) : void
Parameters
- $cellStyleIndex : int
-
Index to cellXf
Return values
void —removeCellXfByIndex()
Remove cellXf by index. It is ensured that all cells get their xf index updated.
public
removeCellXfByIndex(int $cellStyleIndex) : void
Parameters
- $cellStyleIndex : int
-
Index to cellXf
Return values
void —removeDefinedName()
Remove defined name.
public
removeDefinedName(string $definedName[, null|Worksheet $worksheet = null ]) : $this
Parameters
- $definedName : string
- $worksheet : null|Worksheet = null
-
scope: use null for global scope
Return values
$this —removeNamedFormula()
Remove named formula.
public
removeNamedFormula(string $namedFormula[, null|Worksheet $worksheet = null ]) : $this
Parameters
- $namedFormula : string
- $worksheet : null|Worksheet = null
-
scope: use null for global scope
Return values
$this —removeNamedRange()
Remove named range.
public
removeNamedRange(string $namedRange[, null|Worksheet $worksheet = null ]) : $this
Parameters
- $namedRange : string
- $worksheet : null|Worksheet = null
-
scope: use null for global scope
Return values
$this —removeSheetByIndex()
Remove sheet by index.
public
removeSheetByIndex(int $sheetIndex) : void
Parameters
- $sheetIndex : int
-
Index position of the worksheet to remove
Return values
void —setActiveSheetIndex()
Set active sheet index.
public
setActiveSheetIndex(int $worksheetIndex) : Worksheet
Parameters
- $worksheetIndex : int
-
Active sheet index
Return values
Worksheet —setActiveSheetIndexByName()
Set active sheet index by name.
public
setActiveSheetIndexByName(string $worksheetName) : Worksheet
Parameters
- $worksheetName : string
-
Sheet title
Return values
Worksheet —setAutoFilterDateGrouping()
Set whether to group dates when presenting the user with filtering optiomd in the user interface.
public
setAutoFilterDateGrouping(bool $autoFilterDateGrouping) : void
Parameters
- $autoFilterDateGrouping : bool
-
true if workbook window is minimized
Return values
void —setFirstSheetIndex()
Set the first sheet in the book view.
public
setFirstSheetIndex(int $firstSheetIndex) : void
Parameters
- $firstSheetIndex : int
-
First sheet in book view
Return values
void —setHasMacros()
Define if a workbook has macros.
public
setHasMacros(bool $hasMacros) : void
Parameters
- $hasMacros : bool
-
true|false
Return values
void —setIndexByName()
Set index for sheet by sheet name.
public
setIndexByName(string $worksheetName, int $newIndexPosition) : int
Parameters
- $worksheetName : string
-
Sheet name to modify index for
- $newIndexPosition : int
-
New index for the sheet
Return values
int —New sheet index
setMacrosCertificate()
Set the macros certificate.
public
setMacrosCertificate(null|string $certificate) : void
Parameters
- $certificate : null|string
Return values
void —setMacrosCode()
Set the macros code.
public
setMacrosCode(string $macroCode) : void
Parameters
- $macroCode : string
-
string|null
Return values
void —setMinimized()
Set whether the workbook window is minimized.
public
setMinimized(bool $minimized) : void
Parameters
- $minimized : bool
-
true if workbook window is minimized
Return values
void —setProperties()
Set properties.
public
setProperties(Properties $documentProperties) : void
Parameters
- $documentProperties : Properties
Return values
void —setRibbonBinObjects()
store binaries ribbon objects (pictures).
public
setRibbonBinObjects(null|mixed $BinObjectsNames, null|mixed $BinObjectsData) : void
Parameters
- $BinObjectsNames : null|mixed
- $BinObjectsData : null|mixed
Return values
void —setRibbonXMLData()
set ribbon XML data.
public
setRibbonXMLData(null|mixed $target, null|mixed $xmlData) : void
Parameters
- $target : null|mixed
- $xmlData : null|mixed
Return values
void —setSecurity()
Set security.
public
setSecurity(Security $documentSecurity) : void
Parameters
- $documentSecurity : Security
Return values
void —setShowHorizontalScroll()
Set the visibility of the horizonal scroll bar in the application.
public
setShowHorizontalScroll(bool $showHorizontalScroll) : void
Parameters
- $showHorizontalScroll : bool
-
True if horizonal scroll bar is visible
Return values
void —setShowSheetTabs()
Set the visibility of the sheet tabs in the application.
public
setShowSheetTabs(bool $showSheetTabs) : void
Parameters
- $showSheetTabs : bool
-
True if sheet tabs are visible
Return values
void —setShowVerticalScroll()
Set the visibility of the vertical scroll bar in the application.
public
setShowVerticalScroll(bool $showVerticalScroll) : void
Parameters
- $showVerticalScroll : bool
-
True if vertical scroll bar is visible
Return values
void —setTabRatio()
Set the ratio between the workbook tabs bar and the horizontal scroll bar TabRatio is assumed to be out of 1000 of the horizontal window width.
public
setTabRatio(int $tabRatio) : void
Parameters
- $tabRatio : int
-
Ratio between the tabs bar and the horizontal scroll bar
Return values
void —setVisibility()
Set the visibility status of the workbook.
public
setVisibility(null|string $visibility) : void
Valid values are:
- 'visible' (self::VISIBILITY_VISIBLE): Workbook window is visible
- 'hidden' (self::VISIBILITY_HIDDEN): Workbook window is hidden, but can be shown by the user via the user interface
- 'veryHidden' (self::VISIBILITY_VERY_HIDDEN): Workbook window is hidden and cannot be shown in the user interface.
Parameters
- $visibility : null|string
-
visibility status of the workbook
Return values
void —sheetCodeNameExists()
Check if a sheet with a specified code name already exists.
public
sheetCodeNameExists(string $codeName) : bool
Parameters
- $codeName : string
-
Name of the worksheet to check
Return values
bool —sheetNameExists()
Check if a sheet with a specified name already exists.
public
sheetNameExists(string $worksheetName) : bool
Parameters
- $worksheetName : string
-
Name of the worksheet to check
Return values
bool —getExtensionOnly()
return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function).
private
getExtensionOnly(mixed $path) : string
Parameters
- $path : mixed
Return values
string —getGlobalDefinedNameByType()
private
getGlobalDefinedNameByType(string $name, bool $type) : DefinedName|null
Parameters
- $name : string
- $type : bool
Return values
DefinedName|null —getLocalDefinedNameByType()
private
getLocalDefinedNameByType(string $name, bool $type[, Worksheet|null $worksheet = null ]) : DefinedName|null
Parameters
- $name : string
- $type : bool
- $worksheet : Worksheet|null = null