Example:
$workbook = new cells\Workbook(); $sheet = $workbook->getWorksheets()->get(0); //Freeze panes at "AS40" with 10 rows and 10 columns $sheet->freezePanes("AS40", 10, 10); //Add a hyperlink in Cell A1 $sheet->getHyperlinks()->add("A1", 1, 1, "http://www.aspose.com");
Property Getters/Setters Summary | ||
---|---|---|
function | getActiveCell() | |
function | setActiveCell(value) | |
Gets or sets the active cell in the worksheet. | ||
function | getAllowEditRanges() | |
Gets the allow edit range collection in the worksheet.
|
||
function | getAutoFilter() | |
Represents auto filter for the specified worksheet.
|
||
function | getBackgroundImage() | |
function | setBackgroundImage(value) | |
Gets and sets worksheet background image. | ||
function | getCells() | |
Gets the |
||
function | getCellWatches() | |
Gets collection of cells on this worksheet being watched in the 'watch window'.
|
||
function | getCharts() | |
Gets a |
||
function | getCheckBoxes() | |
Gets a |
||
function | getCodeName() | |
function | setCodeName(value) | |
Gets worksheet code name. | ||
function | getComments() | |
Gets the |
||
function | getConditionalFormattings() | |
Gets the ConditionalFormattings in the worksheet.
|
||
function | getCustomProperties() | |
Gets an object representing
the identifier information associated with a worksheet.
|
||
function | getDisplayRightToLeft() | |
function | setDisplayRightToLeft(value) | |
Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false. | ||
function | getDisplayZeros() | |
function | setDisplayZeros(value) | |
True if zero values are displayed. | ||
function | getErrorCheckOptions() | |
Gets error check setting applied on certain ranges.
|
||
function | getFirstVisibleColumn() | |
function | setFirstVisibleColumn(value) | |
Represents first visible column index. | ||
function | getFirstVisibleRow() | |
function | setFirstVisibleRow(value) | |
Represents first visible row index. | ||
function | hasAutofilter() | |
Indicates whether this worksheet has auto filter.
|
||
function | getHorizontalPageBreaks() | |
Gets the |
||
function | getHyperlinks() | |
Gets the |
||
function | getIndex() | |
Gets the index of sheet in the worksheet collection.
|
||
function | isGridlinesVisible() | |
function | setGridlinesVisible(value) | |
Gets or sets a value indicating whether the gridlines are visible.Default is true. | ||
function | isOutlineShown() | |
function | setOutlineShown(value) | |
Indicates whether to show outline. | ||
function | isPageBreakPreview() | |
function | setPageBreakPreview(value) | |
Indicates whether the specified worksheet is shown in normal view or page break preview. | ||
function | isProtected() | |
Indicates if the worksheet is protected.
|
||
function | isRowColumnHeadersVisible() | |
function | setRowColumnHeadersVisible(value) | |
Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true. | ||
function | isRulerVisible() | |
function | setRulerVisible(value) | |
Indicates whether the ruler is visible. This property is only applied for page break preview. | ||
function | isSelected() | |
function | setSelected(value) | |
Indicates whether this worksheet is selected when the workbook is opened. | ||
function | isVisible() | |
function | setVisible(value) | |
Represents if the worksheet is visible. | ||
function | getListObjects() | |
Gets all ListObjects in this worksheet.
|
||
function | getName() | |
function | setName(value) | |
Gets or sets the name of the worksheet. | ||
function | getOleObjects() | |
Represents a collection of |
||
function | getOutline() | |
Gets the outline on this worksheet.
|
||
function | getPageSetup() | |
Represents the page setup description in this sheet.
|
||
function | getPaneState() | |
Indicates whether the pane has horizontal or vertical splits, and whether those splits are frozen.
The value of the property is PaneStateType integer constant. |
||
function | getPictures() | |
Gets a |
||
function | getPivotTables() | |
Gets all pivot tables in this worksheet.
|
||
function | getProtection() | |
Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version.
|
||
function | getQueryTables() | |
Gets |
||
function | getScenarios() | |
Gets the collection of |
||
function | getShapes() | |
Returns all drawing shapes in this worksheet.
|
||
function | getShowFormulas() | |
function | setShowFormulas(value) | |
Indicates whether to show formulas or their results. | ||
function | getSlicers() | |
Get the Slicer collection in the worksheet
|
||
function | getSmartTagSetting() | |
Gets all |
||
function | getSparklineGroups() | |
Gets the sparkline groups in the worksheet.
|
||
function | getTabColor() | |
function | setTabColor(value) | |
Represents worksheet tab color. | ||
function | getTabId() | |
function | setTabId(value) | |
Specifies the internal identifier for the sheet. | ||
function | getTextBoxes() | |
Gets a |
||
function | getTimelines() | |
Get the Timeline collection in the worksheet
|
||
function | getTransitionEntry() | |
function | setTransitionEntry(value) | |
Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled. | ||
function | getTransitionEvaluation() | |
function | setTransitionEvaluation(value) | |
Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled. | ||
function | getType() | |
function | setType(value) | |
Represents worksheet type. The value of the property is SheetType integer constant. | ||
function | getUniqueId() | |
function | setUniqueId(value) | |
Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}. | ||
function | getValidations() | |
Gets the data validation setting collection in the worksheet.
|
||
function | getVerticalPageBreaks() | |
Gets the |
||
function | getViewType() | |
function | setViewType(value) | |
Gets and sets the view type. The value of the property is ViewType integer constant. | ||
function | getVisibilityType() | |
function | setVisibilityType(value) | |
Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant. | ||
function | getWorkbook() | |
Gets the workbook object which contains this sheet.
|
||
function | getZoom() | |
function | setZoom(value) | |
Represents the scaling factor in percentage. It should be between 10 and 400. |
Method Summary | ||
---|---|---|
function | addPageBreaks(cellName) | |
Adds page break.
|
||
function | advancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly) | |
Filters data using complex criteria.
|
||
function | autoFitColumn(columnIndex) | |
Autofits the column width.
|
||
function | autoFitColumn(columnIndex, firstRow, lastRow) | |
Autofits the column width.
|
||
function | autoFitColumns() | |
Autofits all columns in this worksheet.
|
||
function | autoFitColumns(options) | |
Autofits all columns in this worksheet.
|
||
function | autoFitColumns(firstColumn, lastColumn) | |
Autofits the columns width.
|
||
function | autoFitColumns(firstColumn, lastColumn, options) | |
Autofits the columns width.
|
||
function | autoFitColumns(firstRow, firstColumn, lastRow, lastColumn) | |
Autofits the columns width.
|
||
function | autoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options) | |
Autofits the columns width.
|
||
function | autoFitRow(rowIndex) | |
Autofits the row height.
|
||
function | autoFitRow(rowIndex, firstColumn, lastColumn) | |
Autofits the row height.
|
||
function | autoFitRow(rowIndex, firstColumn, lastColumn, options) | |
Autofits the row height.
|
||
function | autoFitRow(startRow, endRow, startColumn, endColumn) | |
Autofits row height in a rectangle range.
|
||
function | autoFitRows() | |
Autofits all rows in this worksheet.
|
||
function | autoFitRows(onlyAuto) | |
Autofits all rows in this worksheet.
|
||
function | autoFitRows(options) | |
Autofits all rows in this worksheet.
|
||
function | autoFitRows(startRow, endRow) | |
Autofits row height in a range.
|
||
function | autoFitRows(startRow, endRow, options) | |
Autofits row height in a range.
|
||
function | calculateArrayFormula(formula, opts) | |
Calculates a formula as array formula.
|
||
function | calculateArrayFormula(formula, opts, maxRowCount, maxColumnCount) | |
Calculates a formula as array formula.
|
||
function | calculateArrayFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, maxRowCount, maxColumnCount, calculationData) | |
Calculates a formula as array formula.
|
||
function | calculateFormula(options, recursive) | |
Calculates all formulas in this worksheet.
|
||
function | calculateFormula(formula) | |
Calculates a formula.
|
||
function | calculateFormula(formula, opts) | |
Calculates a formula expression directly.
|
||
function | calculateFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, calculationData) | |
Calculates a formula expression directly.
|
||
function | clearComments() | |
Clears all comments in designer spreadsheet.
|
||
function | closeAccessCache(opts) | |
Closes the session that uses caches to access the data in this worksheet.
|
||
function | convertFormulaReferenceStyle(formula, toR1C1, baseCellRow, baseCellColumn) | |
Converts the formula reference style.
|
||
function | copy(sourceSheet) | |
Copies contents and formats from another worksheet.
|
||
function | copy(sourceSheet, copyOptions) | |
Copies contents and formats from another worksheet.
|
||
function | dispose() | |
Performs application-defined tasks associated with freeing, releasing, or
resetting unmanaged resources.
|
||
function | freezePanes(row, column, freezedRows, freezedColumns) | |
Freezes panes at the specified cell in the worksheet.
|
||
function | freezePanes(cellName, freezedRows, freezedColumns) | |
Freezes panes at the specified cell in the worksheet.
|
||
function | getAdvancedFilter() | |
Gets the settings of advanced filter.
|
||
function | getFreezedPanes() | |
Gets the freeze panes.
|
||
function | getPanes() | |
Gets the window panes.
|
||
function | getPrintingPageBreaks(options) | |
Gets automatic page breaks.
|
||
function | getSelectedRanges() | |
Gets selected ranges of cells in the designer spreadsheet.
|
||
function | moveTo(index) | |
Moves the sheet to another location in the spreadsheet.
|
||
function | protect(type) | |
Protects worksheet.
|
||
function | protect(type, password, oldPassword) | |
Protects worksheet.
|
||
function | refreshPivotTables() | |
Refreshes all the PivotTables in this Worksheet.
|
||
function | refreshPivotTables(option) | |
Refreshes all the PivotTables in this Worksheet.
|
||
function | removeAllDrawingObjects() | |
Removes all drawing objects in this worksheet.
|
||
function | removeAutoFilter() | |
Removes the auto filter of the worksheet.
|
||
function | removeSplit() | |
Removes split window.
|
||
function | replace(oldString, newString) | |
Replaces all cells' text with a new string.
|
||
function | selectRange(startRow, startColumn, totalRows, totalColumns, removeOthers) | |
Selects a range.
|
||
function | setVisible(isVisible, ignoreError) | |
Sets the visible options.
|
||
function | split() | |
Splits window.
|
||
function | startAccessCache(opts) | |
Starts the session that uses caches to access the data in this worksheet.
|
||
function | toString() | |
Returns a string represents the current Worksheet object.
|
||
function | unFreezePanes() | |
Unfreezes panes in the worksheet.
|
||
function | unprotect() | |
Unprotects worksheet.
|
||
function | unprotect(password) | |
Unprotects worksheet.
|
||
function | xmlMapQuery(path, xmlMap) | |
Query cell areas that mapped/linked to the specific path of xml map.
|
function getProtection()
function getUniqueId() / function setUniqueId(value)
function getWorkbook()
function getCells()
function getQueryTables()
function getPivotTables()
function getType() / function setType(value)
function getName() / function setName(value)
function getShowFormulas() / function setShowFormulas(value)
function isGridlinesVisible() / function setGridlinesVisible(value)
function isRowColumnHeadersVisible() / function setRowColumnHeadersVisible(value)
function getPaneState()
function getDisplayZeros() / function setDisplayZeros(value)
function getDisplayRightToLeft() / function setDisplayRightToLeft(value)
function isOutlineShown() / function setOutlineShown(value)
function isSelected() / function setSelected(value)
function getListObjects()
function getTabId() / function setTabId(value)
function getHorizontalPageBreaks()
function getVerticalPageBreaks()
function getHyperlinks()
function getPageSetup()
function getAutoFilter()
function hasAutofilter()
function getTransitionEvaluation() / function setTransitionEvaluation(value)
function getTransitionEntry() / function setTransitionEntry(value)
function getVisibilityType() / function setVisibilityType(value)
function isVisible() / function setVisible(value)
function getSparklineGroups()
function getCharts()
function getComments()
function getPictures()
function getTextBoxes()
function getCheckBoxes()
function getOleObjects()
function getShapes()
function getSlicers()
function getTimelines()
function getIndex()
function isProtected()
function getValidations()
function getAllowEditRanges()
function getErrorCheckOptions()
function getOutline()
function getFirstVisibleRow() / function setFirstVisibleRow(value)
function getFirstVisibleColumn() / function setFirstVisibleColumn(value)
function getZoom() / function setZoom(value)
function getViewType() / function setViewType(value)
function isPageBreakPreview() / function setPageBreakPreview(value)
function isRulerVisible() / function setRulerVisible(value)
function getTabColor() / function setTabColor(value)
function getCodeName() / function setCodeName(value)
function getBackgroundImage() / function setBackgroundImage(value)
function getConditionalFormattings()
function getActiveCell() / function setActiveCell(value)
function getCustomProperties()
function getSmartTagSetting()
function getScenarios()
function getCellWatches()
function replace(oldString, newString)
oldString: String
- Old string value.newString: String
- New string value.function getSelectedRanges()
function getPrintingPageBreaks(options)
options: ImageOrPrintOptions
- The print optionsfunction toString()
function startAccessCache(opts)
opts: Number
- A function closeAccessCache(opts)
opts: Number
- A function convertFormulaReferenceStyle(formula, toR1C1, baseCellRow, baseCellColumn)
formula: String
- The formula to be converted.toR1C1: boolean
- Which reference style to convert the formula to.
If the original formula is of A1 reference style,
then this value should be true so the formula will be converted from A1 to R1C1 reference style;
If the original formula is of R1C1 reference style,
then this value should be false so the formula will be converted from R1C1 to A1 reference style;
baseCellRow: Number
- The row index of the base cell.baseCellColumn: Number
- The column index of the base cell.function calculateFormula(formula)
formula: String
- Formula to be calculated.function calculateFormula(formula, opts)
formula: String
- Formula to be calculated.opts: CalculationOptions
- Options for calculating formulafunction calculateFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, calculationData)
formula: String
- Formula to be calculated.pOpts: FormulaParseOptions
- Options for parsing formula.cOpts: CalculationOptions
- Options for calculating formula.baseCellRow: Number
- The row index of the base cell.baseCellColumn: Number
- The column index of the base cell.calculationData: CalculationData
- The calculation data. It is used for the situation
that user needs to calculate some static formulas when implementing custom calculation engine.
For such kind of situation, user needs to specify it with the calculation data provided
for function calculateArrayFormula(formula, opts)
formula: String
- Formula to be calculated.opts: CalculationOptions
- Options for calculating formulafunction calculateArrayFormula(formula, opts, maxRowCount, maxColumnCount)
formula: String
- Formula to be calculated.opts: CalculationOptions
- Options for calculating formulamaxRowCount: Number
- the maximum row count of resultant data.
If it is non-positive or greater than the actual row count, then actual row count will be used.
maxColumnCount: Number
- the maximum column count of resultant data.
If it is non-positive or greater than the actual row count, then actual column count will be used.
function calculateArrayFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, maxRowCount, maxColumnCount, calculationData)
formula: String
- Formula to be calculated.pOpts: FormulaParseOptions
- Options for parsing formulacOpts: CalculationOptions
- Options for calculating formulabaseCellRow: Number
- The row index of the base cell.baseCellColumn: Number
- The column index of the base cell.maxRowCount: Number
- The maximum row count of resultant data.
If it is non-positive or greater than the actual row count, then actual row count will be used.
maxColumnCount: Number
- The maximum column count of resultant data.
If it is non-positive or greater than the actual row count, then actual column count will be used.
calculationData: CalculationData
- The calculation data. It is used for the situation
that user needs to calculate some static formulas when implementing custom calculation engine.
For such kind of situation, user needs to specify it with the calculation data provided
for function calculateFormula(options, recursive)
options: CalculationOptions
- Options for calculationrecursive: boolean
- True means if the worksheet' cells depend on the cells of other worksheets,
the dependent cells in other worksheets will be calculated too.
False means all the formulas in the worksheet have been calculated and the values are right.function xmlMapQuery(path, xmlMap)
path: String
- xml element pathxmlMap: XmlMap
- Specify an xml map if you want to query for the specific path within a specific mapfunction refreshPivotTables()
function refreshPivotTables(option)
option: PivotTableRefreshOption
-
The option for refreshing data source of pivot table.
function dispose()
function getPanes()
function freezePanes(row, column, freezedRows, freezedColumns)
Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.
The first two parameters specify the froze position and the last two parameters specify the area frozen on the left top pane.
row: Number
- Row index.column: Number
- Column index.freezedRows: Number
- Number of visible rows in top pane, no more than row index.freezedColumns: Number
- Number of visible columns in left pane, no more than column index.function getFreezedPanes()
function split()
function freezePanes(cellName, freezedRows, freezedColumns)
cellName: String
- Cell name.freezedRows: Number
- Number of visible rows in top pane, no more than row index.freezedColumns: Number
- Number of visible columns in left pane, no more than column index.function unFreezePanes()
function removeSplit()
function addPageBreaks(cellName)
cellName: String
- function copy(sourceSheet)
sourceSheet: Worksheet
- Source worksheet.function copy(sourceSheet, copyOptions)
sourceSheet: Worksheet
- Source worksheet.copyOptions: CopyOptions
- function autoFitColumn(columnIndex, firstRow, lastRow)
columnIndex: Number
- Column index.firstRow: Number
- First row index.lastRow: Number
- Last row index.function autoFitColumns()
function autoFitColumns(options)
options: AutoFitterOptions
- The auto fitting options
function autoFitColumn(columnIndex)
columnIndex: Number
- Column index.function autoFitColumns(firstColumn, lastColumn)
firstColumn: Number
- First column index.lastColumn: Number
- Last column index.function autoFitColumns(firstColumn, lastColumn, options)
firstColumn: Number
- First column index.lastColumn: Number
- Last column index.options: AutoFitterOptions
- The auto fitting optionsfunction autoFitColumns(firstRow, firstColumn, lastRow, lastColumn)
firstRow: Number
- First row index.firstColumn: Number
- First column index.lastRow: Number
- Last row index.lastColumn: Number
- Last column index.function autoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options)
firstRow: Number
- First row index.firstColumn: Number
- First column index.lastRow: Number
- Last row index.lastColumn: Number
- Last column index.options: AutoFitterOptions
- The auto fitting optionsfunction autoFitRow(rowIndex, firstColumn, lastColumn)
rowIndex: Number
- Row index.firstColumn: Number
- First column index.lastColumn: Number
- Last column index.function autoFitRow(rowIndex, firstColumn, lastColumn, options)
rowIndex: Number
- Row index.firstColumn: Number
- First column index.lastColumn: Number
- Last column index.options: AutoFitterOptions
- The auto fitter optionsfunction autoFitRows()
function autoFitRows(onlyAuto)
onlyAuto: boolean
-
True,only autofits the row height when row height is not customed.
function autoFitRows(options)
options: AutoFitterOptions
- The auto fitter optionsfunction autoFitRows(startRow, endRow)
startRow: Number
- Start row index.endRow: Number
- End row index.function autoFitRows(startRow, endRow, options)
startRow: Number
- Start row index.endRow: Number
- End row index.options: AutoFitterOptions
- The options of auto fitter.function autoFitRow(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 autoFitRow(rowIndex)
rowIndex: Number
- Row index.function getAdvancedFilter()
function advancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly)
isFilter: boolean
- Indicates whether filtering the list in place.listRange: String
- The list range.criteriaRange: String
- The criteria range.copyTo: String
- The range where copying data to. uniqueRecordOnly: boolean
- Only displaying or copying unique rows.function removeAutoFilter()
function setVisible(isVisible, ignoreError)
isVisible: boolean
- Whether the worksheet is visibleignoreError: boolean
- Whether to ignore error if this option is not valid.function selectRange(startRow, startColumn, totalRows, totalColumns, removeOthers)
startRow: Number
- The start row.
startColumn: Number
- The start columntotalRows: Number
- The number of rows.totalColumns: Number
- The number of columnsremoveOthers: boolean
- True means removing other selected range and only select this range.
function removeAllDrawingObjects()
function clearComments()
function protect(type)
type: Number
- A function protect(type, password, oldPassword)
type: Number
- A password: String
- Password.oldPassword: String
- If the worksheet is already protected by a password, please supply the old password.
Otherwise, you can set a null value or blank string to this parameter.Example:
//Instantiating a Workbook object $workbook = new cells\Workbook("Book1.xls"); //Accessing the first worksheet in the Excel file $worksheet = $workbook->getWorksheets()->get(0); //Protecting the worksheet with a password $worksheet->protect(cells\ProtectionType::ALL, "aspose", null);
function unprotect()
function unprotect(password)
password: String
- Passwordfunction moveTo(index)
index: Number
- Destination sheet index.