Example:
$workbook = new cells\Workbook(); $sheets = $workbook->getWorksheets(); //Add a worksheet $sheets->add(); //Change the name of a worksheet $sheets->get(0)->setName("First Sheet"); //Set the active sheet to the second worksheet $sheets->setActiveSheetIndex(1);
Property Getters/Setters Summary | ||
---|---|---|
function | getActiveSheetIndex() | |
function | setActiveSheetIndex(value) | |
Represents the index of active worksheet when the spreadsheet is opened. | ||
function | getActiveSheetName() | |
function | setActiveSheetName(value) | |
Represents the name of active worksheet when the spreadsheet is opened. | ||
function | getBuiltInDocumentProperties() | |
Returns a |
||
function | getCount() | |
function | getCustomDocumentProperties() | |
Returns a |
||
function | getDxfs() | |
Gets the master differential formatting records.
|
||
function | getExternalLinks() | |
Represents external links in a workbook.
|
||
function | isRefreshAllConnections() | |
function | setRefreshAllConnections(value) | |
Indicates whether refresh all connections on opening file in MS Excel. | ||
function | getNames() | |
Gets the collection of all the Name objects in the spreadsheet.
|
||
function | getOleSize() | |
function | setOleSize(value) | |
Gets and Sets displayed size when Workbook file is used as an Ole object. | ||
function | getRevisionLogs() | |
Represents revision logs.
|
||
function | getTableStyles() | |
Gets |
||
function | getThreadedCommentAuthors() | |
Gets the list of threaded comment authors.
|
||
function | getWebExtensions() | |
Gets the list of task panes.
|
||
function | getWebExtensionTaskPanes() | |
Gets the list of task panes.
|
||
function | getXmlMaps() | |
function | setXmlMaps(value) | |
Gets and sets the XML maps in the workbook. | ||
function | get(index) | |
Gets the |
||
function | get(sheetName) | |
Gets the |
Method Summary | ||
---|---|---|
function | add() | |
Adds a worksheet to the collection.
|
||
function | add(type) | |
Adds a worksheet to the collection.
|
||
function | add(value) | |
Reserved for internal use. |
||
function | add(sheetName) | |
Adds a worksheet to the collection.
|
||
function | addCopy(source, destSheetNames) | |
Copy a group of worksheets.
|
||
function | addCopy(sheetIndex) | |
Adds a worksheet to the collection and copies data from an existed worksheet.
|
||
function | addCopy(sheetName) | |
Adds a worksheet to the collection and copies data from an existed worksheet.
|
||
function | clear() | |
Clear all worksheets.
|
||
function | clearPivottables() | |
Clears pivot tables from the spreadsheet.
|
||
function | contains(value) | |
Reserved for internal use. |
||
function | createRange(address, sheetIndex) | |
Creates a |
||
function | createUnionRange(address, sheetIndex) | |
Creates a |
||
function | get(index) | |
Reserved for internal use. |
||
function | getNamedRanges() | |
Gets all pre-defined named ranges in the spreadsheet.
|
||
function | getNamedRangesAndTables() | |
Gets all pre-defined named ranges in the spreadsheet.
|
||
function | getRangeByName(rangeName) | |
Gets Range object by pre-defined name.
|
||
function | getRangeByName(rangeName, currentSheetIndex, includeTable) | |
Gets |
||
function | getSheetByCodeName(codeName) | |
Gets the worksheet by the code name.
|
||
function | indexOf(value) | |
Reserved for internal use. |
||
function | insert(index, sheetType) | |
Insert a worksheet.
|
||
function | insert(index, sheetType, sheetName) | |
Insert a worksheet.
|
||
function | iterator() | |
function | refreshAll() | |
Refresh all pivot tables and charts with pivot source.
|
||
function | refreshPivotTables() | |
Refreshes all the PivotTables in the Excel file.
|
||
function | refreshPivotTables(option) | |
Refreshes all the PivotTables in the Excel file.
|
||
function | registerAddInFunction(id, functionName) | |
Adds addin function into the workbook
|
||
function | registerAddInFunction(addInFile, functionName, lib) | |
Adds addin function into the workbook
|
||
function | removeAt(index) | |
Removes the element at a specified index.
|
||
function | removeAt(name) | |
Removes the element at a specified name.
|
||
function | setOleSize(startRow, endRow, startColumn, endColumn) | |
Sets displayed size when Workbook file is used as an Ole object.
|
||
function | sortNames() | |
Sorts the defined names.
|
||
function | swapSheet(sheetIndex1, sheetIndex2) | |
Swaps the two sheets.
|
function getWebExtensionTaskPanes()
function getWebExtensions()
function getThreadedCommentAuthors()
function isRefreshAllConnections() / function setRefreshAllConnections(value)
function getNames()
function getActiveSheetName() / function setActiveSheetName(value)
function getActiveSheetIndex() / function setActiveSheetIndex(value)
function getDxfs()
function getXmlMaps() / function setXmlMaps(value)
function getBuiltInDocumentProperties()
Title
Subject
Author
Keywords
Comments
Template
Last Author
Revision Number
Application Name
Last Print Date
Creation Date
Last Save Time
Total Editing Time
Number of Pages
Number of Words
Number of Characters
Security
Category
Format
Manager
Company
Number of Bytes
Number of Lines
Number of Paragraphs
Number of Slides
Number of Notes
Number of Hidden Slides
Number of Multimedia Clips
Example:
$workbook = new cells\Workbook(); $doc = $workbook->getWorksheets()->getBuiltInDocumentProperties()->get("Author"); $doc->setValue("John Smith");
function getCustomDocumentProperties()
Example:
$workbook = new cells\Workbook(); $workbook->getWorksheets()->getCustomDocumentProperties()->add("Checked by", "Jane");
function getOleSize() / function setOleSize(value)
function getExternalLinks()
function getTableStyles()
function getRevisionLogs()
function getCount()
function get(index)
index
- The zero based index of the element.function get(sheetName)
sheetName
- Worksheet namefunction setOleSize(startRow, endRow, startColumn, endColumn)
startRow: Number
- Start row index.endRow: Number
- End row index.startColumn: Number
- Start column index.endColumn: Number
- End column index.function clearPivottables()
function refreshAll()
function refreshPivotTables()
function refreshPivotTables(option)
option: PivotTableRefreshOption
-
The option for refreshing data source of the pivot tables.
function createRange(address, sheetIndex)
function createUnionRange(address, sheetIndex)
function getSheetByCodeName(codeName)
codeName: String
- Worksheet code name.function sortNames()
function insert(index, sheetType)
index: Number
- The sheet indexsheetType: Number
- A function insert(index, sheetType, sheetName)
index: Number
- The sheet indexsheetType: Number
- A sheetName: String
- The sheet name.function add(type)
type: Number
- A Example:
$workbook = new cells\Workbook(); $workbook->getWorksheets()->add(cells\SheetType::CHART); $cells = $workbook->getWorksheets()->get(0)->getCells(); $cells->get("c2")->putValue(5000); $cells->get("c3")->putValue(3000); $cells->get("c4")->putValue(4000); $cells->get("c5")->putValue(5000); $cells->get("c6")->putValue(6000); $charts = $workbook->getWorksheets()->get(1)->getCharts(); $chartIndex = $charts->add(cells\ChartType::COLUMN, 10, 10, 20, 20); $chart = $charts->get($chartIndex); $chart->getNSeries()->add("Sheet1!C2:C6", true);
function swapSheet(sheetIndex1, sheetIndex2)
sheetIndex1: Number
- The first worksheet.sheetIndex2: Number
- The second worksheet.function add()
function add(sheetName)
sheetName: String
- Worksheet namefunction registerAddInFunction(addInFile, functionName, lib)
addInFile: String
- the file contains the addin functionsfunctionName: String
- the addin function namelib: boolean
- whether the given addin file is in the directory or sub-directory of Workbook Add-In library.
This flag takes effect and makes difference when given addInFile is of relative path:
true denotes the path is relative to Add-In library and false denotes the path is relative to this Workbook.function registerAddInFunction(id, functionName)
id: Number
- ID of the data which contains addin functions,
can be got by the first call of functionName: String
- the addin function namefunction removeAt(name)
name: String
- The name of the element to remove.function removeAt(index)
index: Number
- The index value of the element to remove.function clear()
function addCopy(sheetName)
sheetName: String
- Name of source worksheet.function addCopy(sheetIndex)
sheetIndex: Number
- Index of source worksheet.function addCopy(source, destSheetNames)
source: Worksheet[]
- The source worksheets.destSheetNames: String[]
- The names of the copied sheets.function getRangeByName(rangeName)
rangeName: String
- Name of range.function getRangeByName(rangeName, currentSheetIndex, includeTable)
rangeName: String
- Name of range or table's name.currentSheetIndex: Number
- The sheet index. -1 represents global .includeTable: boolean
- Indicates whether checking all tables.function getNamedRanges()
function getNamedRangesAndTables()
function iterator()
function get(index)
function contains(value)
function add(value)
function indexOf(value)