ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPExcel_Worksheet Class Reference
+ Inheritance diagram for PHPExcel_Worksheet:
+ Collaboration diagram for PHPExcel_Worksheet:

Public Member Functions

 __construct (PHPExcel $pParent=null, $pTitle='Worksheet')
 Create a new worksheet. More...
 
 disconnectCells ()
 Disconnect all cells from this PHPExcel_Worksheet object, typically so that the worksheet object can be unset. More...
 
 __destruct ()
 Code to execute when this worksheet is unset() More...
 
 getCellCacheController ()
 Return the cache controller for the cell collection. More...
 
 getCellCollection ($pSorted=true)
 Get collection of cells. More...
 
 sortCellCollection ()
 Sort collection of cells. More...
 
 getRowDimensions ()
 Get collection of row dimensions. More...
 
 getDefaultRowDimension ()
 Get default row dimension. More...
 
 getColumnDimensions ()
 Get collection of column dimensions. More...
 
 getDefaultColumnDimension ()
 Get default column dimension. More...
 
 getDrawingCollection ()
 Get collection of drawings. More...
 
 getChartCollection ()
 Get collection of charts. More...
 
 addChart (PHPExcel_Chart $pChart=null, $iChartIndex=null)
 Add chart. More...
 
 getChartCount ()
 Return the count of charts on this worksheet. More...
 
 getChartByIndex ($index=null)
 Get a chart by its index position. More...
 
 getChartNames ()
 Return an array of the names of charts on this worksheet. More...
 
 getChartByName ($chartName='')
 Get a chart by name. More...
 
 refreshColumnDimensions ()
 Refresh column dimensions. More...
 
 refreshRowDimensions ()
 Refresh row dimensions. More...
 
 calculateWorksheetDimension ()
 Calculate worksheet dimension. More...
 
 calculateWorksheetDataDimension ()
 Calculate worksheet data dimension. More...
 
 calculateColumnWidths ($calculateMergeCells=false)
 Calculate widths for auto-size columns. More...
 
 getParent ()
 Get parent. More...
 
 rebindParent (PHPExcel $parent)
 Re-bind parent. More...
 
 getTitle ()
 Get title. More...
 
 setTitle ($pValue='Worksheet', $updateFormulaCellReferences=true)
 Set title. More...
 
 getSheetState ()
 Get sheet state. More...
 
 setSheetState ($value=PHPExcel_Worksheet::SHEETSTATE_VISIBLE)
 Set sheet state. More...
 
 getPageSetup ()
 Get page setup. More...
 
 setPageSetup (PHPExcel_Worksheet_PageSetup $pValue)
 Set page setup. More...
 
 getPageMargins ()
 Get page margins. More...
 
 setPageMargins (PHPExcel_Worksheet_PageMargins $pValue)
 Set page margins. More...
 
 getHeaderFooter ()
 Get page header/footer. More...
 
 setHeaderFooter (PHPExcel_Worksheet_HeaderFooter $pValue)
 Set page header/footer. More...
 
 getSheetView ()
 Get sheet view. More...
 
 setSheetView (PHPExcel_Worksheet_SheetView $pValue)
 Set sheet view. More...
 
 getProtection ()
 Get Protection. More...
 
 setProtection (PHPExcel_Worksheet_Protection $pValue)
 Set Protection. More...
 
 getHighestColumn ($row=null)
 Get highest worksheet column. More...
 
 getHighestDataColumn ($row=null)
 Get highest worksheet column that contains data. More...
 
 getHighestRow ($column=null)
 Get highest worksheet row. More...
 
 getHighestDataRow ($column=null)
 Get highest worksheet row that contains data. More...
 
 getHighestRowAndColumn ()
 Get highest worksheet column and highest row that have cell records. More...
 
 setCellValue ($pCoordinate='A1', $pValue=null, $returnCell=false)
 Set a cell value. More...
 
 setCellValueByColumnAndRow ($pColumn=0, $pRow=1, $pValue=null, $returnCell=false)
 Set a cell value by using numeric cell coordinates. More...
 
 setCellValueExplicit ($pCoordinate='A1', $pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING, $returnCell=false)
 Set a cell value. More...
 
 setCellValueExplicitByColumnAndRow ($pColumn=0, $pRow=1, $pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING, $returnCell=false)
 Set a cell value by using numeric cell coordinates. More...
 
 getCell ($pCoordinate='A1')
 Get cell at a specific coordinate. More...
 
 getCellByColumnAndRow ($pColumn=0, $pRow=1)
 Get cell at a specific coordinate by using numeric cell coordinates. More...
 
 cellExists ($pCoordinate='A1')
 Does the cell at a specific coordinate exist? More...
 
 cellExistsByColumnAndRow ($pColumn=0, $pRow=1)
 Cell at a specific coordinate by using numeric cell coordinates exists? More...
 
 getRowDimension ($pRow=1, $create=TRUE)
 Get row dimension at a specific row. More...
 
 getColumnDimension ($pColumn='A', $create=TRUE)
 Get column dimension at a specific column. More...
 
 getColumnDimensionByColumn ($pColumn=0)
 Get column dimension at a specific column by using numeric cell coordinates. More...
 
 getStyles ()
 Get styles. More...
 
 getDefaultStyle ()
 Get default style of workbook. More...
 
 setDefaultStyle (PHPExcel_Style $pValue)
 Set default style - should only be used by PHPExcel_IReader implementations! More...
 
 getStyle ($pCellCoordinate='A1')
 Get style for cell. More...
 
 getConditionalStyles ($pCoordinate='A1')
 Get conditional styles for a cell. More...
 
 conditionalStylesExists ($pCoordinate='A1')
 Do conditional styles exist for this cell? More...
 
 removeConditionalStyles ($pCoordinate='A1')
 Removes conditional styles for a cell. More...
 
 getConditionalStylesCollection ()
 Get collection of conditional styles. More...
 
 setConditionalStyles ($pCoordinate='A1', $pValue)
 Set conditional styles. More...
 
 getStyleByColumnAndRow ($pColumn=0, $pRow=1, $pColumn2=null, $pRow2=null)
 Get style for cell by using numeric cell coordinates. More...
 
 setSharedStyle (PHPExcel_Style $pSharedCellStyle=null, $pRange='')
 Set shared cell style to a range of cells. More...
 
 duplicateStyle (PHPExcel_Style $pCellStyle=null, $pRange='')
 Duplicate cell style to a range of cells. More...
 
 duplicateConditionalStyle (array $pCellStyle=null, $pRange='')
 Duplicate conditional style to a range of cells. More...
 
 duplicateStyleArray ($pStyles=null, $pRange='', $pAdvanced=true)
 Duplicate cell style array to a range of cells. More...
 
 setBreak ($pCell='A1', $pBreak=PHPExcel_Worksheet::BREAK_NONE)
 Set break on a cell. More...
 
 setBreakByColumnAndRow ($pColumn=0, $pRow=1, $pBreak=PHPExcel_Worksheet::BREAK_NONE)
 Set break on a cell by using numeric cell coordinates. More...
 
 getBreaks ()
 Get breaks. More...
 
 mergeCells ($pRange='A1:A1')
 Set merge on a cell range. More...
 
 mergeCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1)
 Set merge on a cell range by using numeric cell coordinates. More...
 
 unmergeCells ($pRange='A1:A1')
 Remove merge on a cell range. More...
 
 unmergeCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1)
 Remove merge on a cell range by using numeric cell coordinates. More...
 
 getMergeCells ()
 Get merge cells array. More...
 
 setMergeCells ($pValue=array())
 Set merge cells array for the entire sheet. More...
 
 protectCells ($pRange='A1', $pPassword='', $pAlreadyHashed=false)
 Set protection on a cell range. More...
 
 protectCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1, $pPassword='', $pAlreadyHashed=false)
 Set protection on a cell range by using numeric cell coordinates. More...
 
 unprotectCells ($pRange='A1')
 Remove protection on a cell range. More...
 
 unprotectCellsByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1, $pPassword='', $pAlreadyHashed=false)
 Remove protection on a cell range by using numeric cell coordinates. More...
 
 getProtectedCells ()
 Get protected cells. More...
 
 getAutoFilter ()
 Get Autofilter. More...
 
 setAutoFilter ($pValue)
 Set AutoFilter. More...
 
 setAutoFilterByColumnAndRow ($pColumn1=0, $pRow1=1, $pColumn2=0, $pRow2=1)
 Set Autofilter Range by using numeric cell coordinates. More...
 
 removeAutoFilter ()
 Remove autofilter. More...
 
 getFreezePane ()
 Get Freeze Pane. More...
 
 freezePane ($pCell='')
 Freeze Pane. More...
 
 freezePaneByColumnAndRow ($pColumn=0, $pRow=1)
 Freeze Pane by using numeric cell coordinates. More...
 
 unfreezePane ()
 Unfreeze Pane. More...
 
 insertNewRowBefore ($pBefore=1, $pNumRows=1)
 Insert a new row, updating all possible related data. More...
 
 insertNewColumnBefore ($pBefore='A', $pNumCols=1)
 Insert a new column, updating all possible related data. More...
 
 insertNewColumnBeforeByIndex ($pBefore=0, $pNumCols=1)
 Insert a new column, updating all possible related data. More...
 
 removeRow ($pRow=1, $pNumRows=1)
 Delete a row, updating all possible related data. More...
 
 removeColumn ($pColumn='A', $pNumCols=1)
 Remove a column, updating all possible related data. More...
 
 removeColumnByIndex ($pColumn=0, $pNumCols=1)
 Remove a column, updating all possible related data. More...
 
 getShowGridlines ()
 Show gridlines? More...
 
 setShowGridlines ($pValue=false)
 Set show gridlines. More...
 
 getPrintGridlines ()
 Print gridlines? More...
 
 setPrintGridlines ($pValue=false)
 Set print gridlines. More...
 
 getShowRowColHeaders ()
 Show row and column headers? More...
 
 setShowRowColHeaders ($pValue=false)
 Set show row and column headers. More...
 
 getShowSummaryBelow ()
 Show summary below? (Row/Column outlining) More...
 
 setShowSummaryBelow ($pValue=true)
 Set show summary below. More...
 
 getShowSummaryRight ()
 Show summary right? (Row/Column outlining) More...
 
 setShowSummaryRight ($pValue=true)
 Set show summary right. More...
 
 getComments ()
 Get comments. More...
 
 setComments ($pValue=array())
 Set comments array for the entire sheet. More...
 
 getComment ($pCellCoordinate='A1')
 Get comment for cell. More...
 
 getCommentByColumnAndRow ($pColumn=0, $pRow=1)
 Get comment for cell by using numeric cell coordinates. More...
 
 getSelectedCell ()
 Get selected cell. More...
 
 getActiveCell ()
 Get active cell. More...
 
 getSelectedCells ()
 Get selected cells. More...
 
 setSelectedCell ($pCoordinate='A1')
 Selected cell. More...
 
 setSelectedCells ($pCoordinate='A1')
 Select a range of cells. More...
 
 setSelectedCellByColumnAndRow ($pColumn=0, $pRow=1)
 Selected cell by using numeric cell coordinates. More...
 
 getRightToLeft ()
 Get right-to-left. More...
 
 setRightToLeft ($value=false)
 Set right-to-left. More...
 
 fromArray ($source=null, $nullValue=null, $startCell='A1', $strictNullComparison=false)
 Fill worksheet from values in array. More...
 
 rangeToArray ($pRange='A1', $nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
 Create array from a range of cells. More...
 
 namedRangeToArray ($pNamedRange='', $nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
 Create array from a range of cells. More...
 
 toArray ($nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
 Create array from worksheet. More...
 
 getRowIterator ($startRow=1, $endRow=null)
 Get row iterator. More...
 
 getColumnIterator ($startColumn='A', $endColumn=null)
 Get column iterator. More...
 
 garbageCollect ()
 Run PHPExcel garabage collector. More...
 
 getHashCode ()
 Get hash code. More...
 
 getHyperlink ($pCellCoordinate='A1')
 Get hyperlink. More...
 
 setHyperlink ($pCellCoordinate='A1', PHPExcel_Cell_Hyperlink $pHyperlink=null)
 Set hyperlnk. More...
 
 hyperlinkExists ($pCoordinate='A1')
 Hyperlink at a specific coordinate exists? More...
 
 getHyperlinkCollection ()
 Get collection of hyperlinks. More...
 
 getDataValidation ($pCellCoordinate='A1')
 Get data validation. More...
 
 setDataValidation ($pCellCoordinate='A1', PHPExcel_Cell_DataValidation $pDataValidation=null)
 Set data validation. More...
 
 dataValidationExists ($pCoordinate='A1')
 Data validation at a specific coordinate exists? More...
 
 getDataValidationCollection ()
 Get collection of data validations. More...
 
 shrinkRangeToFit ($range)
 Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet. More...
 
 getTabColor ()
 Get tab color. More...
 
 resetTabColor ()
 Reset tab color. More...
 
 isTabColorSet ()
 Tab color set? More...
 
 copy ()
 Copy worksheet (!= clone!) More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
 setCodeName ($pValue=null)
 Define the code name of the sheet. More...
 
 getCodeName ()
 Return the code name of the sheet. More...
 
 hasCodeName ()
 Sheet has a code name ? More...
 
 getHashCode ()
 Get hash code. More...
 

Static Public Member Functions

static getInvalidCharacters ()
 Get array of invalid characters for sheet title. More...
 
static extractSheetTitle ($pRange, $returnRange=false)
 Extract worksheet title from range. More...
 

Data Fields

const BREAK_NONE = 0
 
const BREAK_ROW = 1
 
const BREAK_COLUMN = 2
 
const SHEETSTATE_VISIBLE = 'visible'
 
const SHEETSTATE_HIDDEN = 'hidden'
 
const SHEETSTATE_VERYHIDDEN = 'veryHidden'
 

Private Member Functions

 _createNewCell ($pCoordinate)
 Create a new cell at the specified coordinate. More...
 

Static Private Member Functions

static _checkSheetCodeName ($pValue)
 Check sheet code name for valid Excel syntax. More...
 
static _checkSheetTitle ($pValue)
 Check sheet title for valid Excel syntax. More...
 

Private Attributes

 $_parent
 
 $_cellCollection = null
 
 $_rowDimensions = array()
 
 $_defaultRowDimension = null
 
 $_columnDimensions = array()
 
 $_defaultColumnDimension = null
 
 $_drawingCollection = null
 
 $_chartCollection = array()
 
 $_title
 
 $_sheetState
 
 $_pageSetup
 
 $_pageMargins
 
 $_headerFooter
 
 $_sheetView
 
 $_protection
 
 $_styles = array()
 
 $_conditionalStylesCollection = array()
 
 $_cellCollectionIsSorted = false
 
 $_breaks = array()
 
 $_mergeCells = array()
 
 $_protectedCells = array()
 
 $_autoFilter = NULL
 
 $_freezePane = ''
 
 $_showGridlines = true
 
 $_printGridlines = false
 
 $_showRowColHeaders = true
 
 $_showSummaryBelow = true
 
 $_showSummaryRight = true
 
 $_comments = array()
 
 $_activeCell = 'A1'
 
 $_selectedCells = 'A1'
 
 $_cachedHighestColumn = 'A'
 
 $_cachedHighestRow = 1
 
 $_rightToLeft = false
 
 $_hyperlinkCollection = array()
 
 $_dataValidationCollection = array()
 
 $_tabColor
 
 $_dirty = true
 
 $_hash = null
 
 $_codeName = null
 

Static Private Attributes

static $_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']')
 

Detailed Description

Definition at line 36 of file Worksheet.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Worksheet::__construct ( PHPExcel  $pParent = null,
  $pTitle = 'Worksheet' 
)

Create a new worksheet.

Parameters
PHPExcel$pParent
string$pTitle

Definition at line 341 of file Worksheet.php.

342 {
343 // Set parent and title
344 $this->_parent = $pParent;
345 $this->setTitle($pTitle, FALSE);
346 // setTitle can change $pTitle
347 $this->setCodeName($this->getTitle());
349
350 $this->_cellCollection = PHPExcel_CachedObjectStorageFactory::getInstance($this);
351
352 // Set page setup
353 $this->_pageSetup = new PHPExcel_Worksheet_PageSetup();
354
355 // Set page margins
356 $this->_pageMargins = new PHPExcel_Worksheet_PageMargins();
357
358 // Set page header/footer
359 $this->_headerFooter = new PHPExcel_Worksheet_HeaderFooter();
360
361 // Set sheet view
362 $this->_sheetView = new PHPExcel_Worksheet_SheetView();
363
364 // Drawing collection
365 $this->_drawingCollection = new ArrayObject();
366
367 // Chart collection
368 $this->_chartCollection = new ArrayObject();
369
370 // Protection
371 $this->_protection = new PHPExcel_Worksheet_Protection();
372
373 // Default row dimension
374 $this->_defaultRowDimension = new PHPExcel_Worksheet_RowDimension(NULL);
375
376 // Default column dimension
377 $this->_defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(NULL);
378
379 $this->_autoFilter = new PHPExcel_Worksheet_AutoFilter(NULL, $this);
380 }
static getInstance(PHPExcel_Worksheet $parent)
Initialise the cache storage.
setCodeName($pValue=null)
Define the code name of the sheet.
Definition: Worksheet.php:2887
setTitle($pValue='Worksheet', $updateFormulaCellReferences=true)
Set title.
Definition: Worksheet.php:833
getTitle()
Get title.
Definition: Worksheet.php:817
const SHEETSTATE_VISIBLE
Definition: Worksheet.php:44
setSheetState($value=PHPExcel_Worksheet::SHEETSTATE_VISIBLE)
Set sheet state.
Definition: Worksheet.php:904

References PHPExcel_CachedObjectStorageFactory\getInstance(), getTitle(), setCodeName(), setSheetState(), setTitle(), and SHEETSTATE_VISIBLE.

+ Here is the call graph for this function:

◆ __destruct()

PHPExcel_Worksheet::__destruct ( )

Code to execute when this worksheet is unset()

Definition at line 401 of file Worksheet.php.

401 {
403 ->clearCalculationCacheForWorksheet($this->_title);
404
405 $this->disconnectCells();
406 }
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.
disconnectCells()
Disconnect all cells from this PHPExcel_Worksheet object, typically so that the worksheet object can ...
Definition: Worksheet.php:388

References disconnectCells(), and PHPExcel_Calculation\getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

PHPExcel_Worksheet::__clone ( )

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

Definition at line 2856 of file Worksheet.php.

2856 {
2857 foreach ($this as $key => $val) {
2858 if ($key == '_parent') {
2859 continue;
2860 }
2861
2862 if (is_object($val) || (is_array($val))) {
2863 if ($key == '_cellCollection') {
2864 $newCollection = clone $this->_cellCollection;
2865 $newCollection->copyCellCollection($this);
2866 $this->_cellCollection = $newCollection;
2867 } elseif ($key == '_drawingCollection') {
2868 $newCollection = clone $this->_drawingCollection;
2869 $this->_drawingCollection = $newCollection;
2870 } elseif (($key == '_autoFilter') && ($this->_autoFilter instanceof PHPExcel_Worksheet_AutoFilter)) {
2871 $newAutoFilter = clone $this->_autoFilter;
2872 $this->_autoFilter = $newAutoFilter;
2873 $this->_autoFilter->setParent($this);
2874 } else {
2875 $this->{$key} = unserialize(serialize($val));
2876 }
2877 }
2878 }
2879 }

References $_autoFilter, $_cellCollection, and $_drawingCollection.

◆ _checkSheetCodeName()

static PHPExcel_Worksheet::_checkSheetCodeName (   $pValue)
staticprivate

Check sheet code name for valid Excel syntax.

Parameters
string$pValueThe string to check
Returns
string The valid string
Exceptions
Exception

Definition at line 435 of file Worksheet.php.

436 {
437 $CharCount = PHPExcel_Shared_String::CountCharacters($pValue);
438 if ($CharCount == 0) {
439 throw new PHPExcel_Exception('Sheet code name cannot be empty.');
440 }
441 // Some of the printable ASCII characters are invalid: * : / \ ? [ ] and first and last characters cannot be a "'"
442 if ((str_replace(self::$_invalidCharacters, '', $pValue) !== $pValue) ||
443 (PHPExcel_Shared_String::Substring($pValue,-1,1)=='\'') ||
444 (PHPExcel_Shared_String::Substring($pValue,0,1)=='\'')) {
445 throw new PHPExcel_Exception('Invalid character found in sheet code name');
446 }
447
448 // Maximum 31 characters allowed for sheet title
449 if ($CharCount > 31) {
450 throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet code name.');
451 }
452
453 return $pValue;
454 }
static CountCharacters($value, $enc='UTF-8')
Get character count.
Definition: String.php:550
static Substring($pValue='', $pStart=0, $pLength=0)
Get a substring of a UTF-8 encoded string.
Definition: String.php:572

References PHPExcel_Shared_String\CountCharacters(), and PHPExcel_Shared_String\Substring().

Referenced by setCodeName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkSheetTitle()

static PHPExcel_Worksheet::_checkSheetTitle (   $pValue)
staticprivate

Check sheet title for valid Excel syntax.

Parameters
string$pValueThe string to check
Returns
string The valid string
Exceptions
PHPExcel_Exception

Definition at line 463 of file Worksheet.php.

464 {
465 // Some of the printable ASCII characters are invalid: * : / \ ? [ ]
466 if (str_replace(self::$_invalidCharacters, '', $pValue) !== $pValue) {
467 throw new PHPExcel_Exception('Invalid character found in sheet title');
468 }
469
470 // Maximum 31 characters allowed for sheet title
471 if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) {
472 throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet title.');
473 }
474
475 return $pValue;
476 }

References PHPExcel_Shared_String\CountCharacters().

Referenced by setTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _createNewCell()

PHPExcel_Worksheet::_createNewCell (   $pCoordinate)
private

Create a new cell at the specified coordinate.

Parameters
string$pCoordinateCoordinate of the cell
Returns
PHPExcel_Cell Cell that was created

Definition at line 1215 of file Worksheet.php.

1216 {
1217 $cell = $this->_cellCollection->addCacheData(
1218 $pCoordinate,
1219 new PHPExcel_Cell(
1220 NULL,
1222 $this
1223 )
1224 );
1225 $this->_cellCollectionIsSorted = false;
1226
1227 // Coordinates
1228 $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
1229 if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($aCoordinates[0]))
1230 $this->_cachedHighestColumn = $aCoordinates[0];
1231 $this->_cachedHighestRow = max($this->_cachedHighestRow, $aCoordinates[1]);
1232
1233 // Cell needs appropriate xfIndex from dimensions records
1234 // but don't create dimension records if they don't already exist
1235 $rowDimension = $this->getRowDimension($aCoordinates[1], FALSE);
1236 $columnDimension = $this->getColumnDimension($aCoordinates[0], FALSE);
1237
1238 if ($rowDimension !== NULL && $rowDimension->getXfIndex() > 0) {
1239 // then there is a row dimension with explicit style, assign it to the cell
1240 $cell->setXfIndex($rowDimension->getXfIndex());
1241 } elseif ($columnDimension !== NULL && $columnDimension->getXfIndex() > 0) {
1242 // then there is a column dimension, assign it to the cell
1243 $cell->setXfIndex($columnDimension->getXfIndex());
1244 }
1245
1246 return $cell;
1247 }
static coordinateFromString($pCoordinateString='A1')
Coordinate from string.
Definition: Cell.php:580
static columnIndexFromString($pString='A')
Column index from string.
Definition: Cell.php:782
getRowDimension($pRow=1, $create=TRUE)
Get row dimension at a specific row.
Definition: Worksheet.php:1315
getColumnDimension($pColumn='A', $create=TRUE)
Get column dimension at a specific column.
Definition: Worksheet.php:1337

References PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), getColumnDimension(), getRowDimension(), and PHPExcel_Cell_DataType\TYPE_NULL.

Referenced by getCell(), and getCellByColumnAndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addChart()

PHPExcel_Worksheet::addChart ( PHPExcel_Chart  $pChart = null,
  $iChartIndex = null 
)

Add chart.

Parameters
PHPExcel_Chart$pChart
int | null$iChartIndexIndex where chart should go (0,1,..., or null for last)
Returns
PHPExcel_Chart

Definition at line 576 of file Worksheet.php.

577 {
578 $pChart->setWorksheet($this);
579 if (is_null($iChartIndex)) {
580 $this->_chartCollection[] = $pChart;
581 } else {
582 // Insert the chart at the requested index
583 array_splice($this->_chartCollection, $iChartIndex, 0, array($pChart));
584 }
585
586 return $pChart;
587 }
setWorksheet(PHPExcel_Worksheet $pValue=null)
Set Worksheet.
Definition: Chart.php:221

◆ calculateColumnWidths()

PHPExcel_Worksheet::calculateColumnWidths (   $calculateMergeCells = false)

Calculate widths for auto-size columns.

Parameters
boolean$calculateMergeCellsCalculate merge cell width
Returns
PHPExcel_Worksheet;

Definition at line 724 of file Worksheet.php.

725 {
726 // initialize $autoSizes array
727 $autoSizes = array();
728 foreach ($this->getColumnDimensions() as $colDimension) {
729 if ($colDimension->getAutoSize()) {
730 $autoSizes[$colDimension->getColumnIndex()] = -1;
731 }
732 }
733
734 // There is only something to do if there are some auto-size columns
735 if (!empty($autoSizes)) {
736
737 // build list of cells references that participate in a merge
738 $isMergeCell = array();
739 foreach ($this->getMergeCells() as $cells) {
740 foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) {
741 $isMergeCell[$cellReference] = true;
742 }
743 }
744
745 // loop through all cells in the worksheet
746 foreach ($this->getCellCollection(false) as $cellID) {
747 $cell = $this->getCell($cellID);
748 if (isset($autoSizes[$this->_cellCollection->getCurrentColumn()])) {
749 // Determine width if cell does not participate in a merge
750 if (!isset($isMergeCell[$this->_cellCollection->getCurrentAddress()])) {
751 // Calculated value
752 // To formatted string
754 $cell->getCalculatedValue(),
755 $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode()
756 );
757
758 $autoSizes[$this->_cellCollection->getCurrentColumn()] = max(
759 (float) $autoSizes[$this->_cellCollection->getCurrentColumn()],
761 $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(),
762 $cellValue,
763 $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(),
764 $this->getDefaultStyle()->getFont()
765 )
766 );
767 }
768 }
769 }
770
771 // adjust column widths
772 foreach ($autoSizes as $columnIndex => $width) {
773 if ($width == -1) $width = $this->getDefaultColumnDimension()->getWidth();
774 $this->getColumnDimension($columnIndex)->setWidth($width);
775 }
776 }
777
778 return $this;
779 }
static extractAllCellReferencesInRange($pRange='A1')
Extract all cell references in range.
Definition: Cell.php:854
static calculateColumnWidth(PHPExcel_Style_Font $font, $cellText='', $rotation=0, PHPExcel_Style_Font $defaultFont=null)
Calculate an (approximate) OpenXML column width, based on font size and text contained.
Definition: Font.php:252
static toFormattedString($value='0', $format=PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack=null)
Convert a value in a pre-defined format to a PHP string.
getCell($pCoordinate='A1')
Get cell at a specific coordinate.
Definition: Worksheet.php:1153
getDefaultColumnDimension()
Get default column dimension.
Definition: Worksheet.php:544
getMergeCells()
Get merge cells array.
Definition: Worksheet.php:1781
getCellCollection($pSorted=true)
Get collection of cells.
Definition: Worksheet.php:484
getColumnDimensions()
Get collection of column dimensions.
Definition: Worksheet.php:534

References PHPExcel_Shared_Font\calculateColumnWidth(), PHPExcel_Cell\extractAllCellReferencesInRange(), getCell(), getCellCollection(), getColumnDimension(), getColumnDimensions(), getDefaultColumnDimension(), getMergeCells(), and PHPExcel_Style_NumberFormat\toFormattedString().

+ Here is the call graph for this function:

◆ calculateWorksheetDataDimension()

PHPExcel_Worksheet::calculateWorksheetDataDimension ( )

Calculate worksheet data dimension.

Returns
string String containing the dimension of this worksheet that actually contain data

Definition at line 712 of file Worksheet.php.

713 {
714 // Return
715 return 'A1' . ':' . $this->getHighestDataColumn() . $this->getHighestDataRow();
716 }
getHighestDataRow($column=null)
Get highest worksheet row that contains data.
Definition: Worksheet.php:1070
getHighestDataColumn($row=null)
Get highest worksheet column that contains data.
Definition: Worksheet.php:1043

References getHighestDataColumn(), and getHighestDataRow().

+ Here is the call graph for this function:

◆ calculateWorksheetDimension()

PHPExcel_Worksheet::calculateWorksheetDimension ( )

Calculate worksheet dimension.

Returns
string String containing the dimension of this worksheet

Definition at line 701 of file Worksheet.php.

702 {
703 // Return
704 return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow();
705 }
getHighestColumn($row=null)
Get highest worksheet column.
Definition: Worksheet.php:1028
getHighestRow($column=null)
Get highest worksheet row.
Definition: Worksheet.php:1055

References getHighestColumn(), and getHighestRow().

+ Here is the call graph for this function:

◆ cellExists()

PHPExcel_Worksheet::cellExists (   $pCoordinate = 'A1')

Does the cell at a specific coordinate exist?

Parameters
string$pCoordinateCoordinate of the cell
Exceptions
PHPExcel_Exception
Returns
boolean

Definition at line 1256 of file Worksheet.php.

1257 {
1258 // Worksheet reference?
1259 if (strpos($pCoordinate, '!') !== false) {
1260 $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
1261 return $this->_parent->getSheetByName($worksheetReference[0])->cellExists(strtoupper($worksheetReference[1]));
1262 }
1263
1264 // Named range?
1265 if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
1266 (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
1267 $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
1268 if ($namedRange !== NULL) {
1269 $pCoordinate = $namedRange->getRange();
1270 if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
1271 if (!$namedRange->getLocalOnly()) {
1272 return $namedRange->getWorksheet()->cellExists($pCoordinate);
1273 } else {
1274 throw new PHPExcel_Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
1275 }
1276 }
1277 }
1278 else { return false; }
1279 }
1280
1281 // Uppercase coordinate
1282 $pCoordinate = strtoupper($pCoordinate);
1283
1284 if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
1285 throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.');
1286 } elseif (strpos($pCoordinate,'$') !== false) {
1287 throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
1288 } else {
1289 // Coordinates
1290 $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
1291
1292 // Cell exists?
1293 return $this->_cellCollection->isDataSet($pCoordinate);
1294 }
1295 }
const CALCULATION_REGEXP_CELLREF
Definition: Calculation.php:75
const CALCULATION_REGEXP_NAMEDRANGE
Definition: Calculation.php:77
static resolveRange($pNamedRange='', PHPExcel_Worksheet $pSheet)
Resolve a named range to a regular cell range.
Definition: NamedRange.php:229
getHashCode()
Get hash code.
Definition: Worksheet.php:2632
static extractSheetTitle($pRange, $returnRange=false)
Extract worksheet title from range.
Definition: Worksheet.php:2654

References PHPExcel_Calculation\CALCULATION_REGEXP_CELLREF, PHPExcel_Calculation\CALCULATION_REGEXP_NAMEDRANGE, PHPExcel_Cell\coordinateFromString(), extractSheetTitle(), getHashCode(), and PHPExcel_NamedRange\resolveRange().

Referenced by cellExistsByColumnAndRow(), and mergeCells().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cellExistsByColumnAndRow()

PHPExcel_Worksheet::cellExistsByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Cell at a specific coordinate by using numeric cell coordinates exists?

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
Returns
boolean

Definition at line 1304 of file Worksheet.php.

1305 {
1306 return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
1307 }
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
Definition: Cell.php:825
cellExists($pCoordinate='A1')
Does the cell at a specific coordinate exist?
Definition: Worksheet.php:1256

References cellExists(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ conditionalStylesExists()

PHPExcel_Worksheet::conditionalStylesExists (   $pCoordinate = 'A1')

Do conditional styles exist for this cell?

Parameters
string$pCoordinate
Returns
boolean

Definition at line 1445 of file Worksheet.php.

1446 {
1447 if (isset($this->_conditionalStylesCollection[strtoupper($pCoordinate)])) {
1448 return true;
1449 }
1450 return false;
1451 }

◆ copy()

PHPExcel_Worksheet::copy ( )

Copy worksheet (!= clone!)

Returns
PHPExcel_Worksheet

Definition at line 2847 of file Worksheet.php.

2847 {
2848 $copied = clone $this;
2849
2850 return $copied;
2851 }

◆ dataValidationExists()

PHPExcel_Worksheet::dataValidationExists (   $pCoordinate = 'A1')

Data validation at a specific coordinate exists?

Parameters
string$pCoordinate
Returns
boolean

Definition at line 2764 of file Worksheet.php.

2765 {
2766 return isset($this->_dataValidationCollection[$pCoordinate]);
2767 }

◆ disconnectCells()

PHPExcel_Worksheet::disconnectCells ( )

Disconnect all cells from this PHPExcel_Worksheet object, typically so that the worksheet object can be unset.

Definition at line 388 of file Worksheet.php.

388 {
389 if ( $this->_cellCollection !== NULL){
390 $this->_cellCollection->unsetWorksheetCells();
391 $this->_cellCollection = NULL;
392 }
393 // detach ourself from the workbook, so that it can then delete this worksheet successfully
394 $this->_parent = null;
395 }

Referenced by __destruct().

+ Here is the caller graph for this function:

◆ duplicateConditionalStyle()

PHPExcel_Worksheet::duplicateConditionalStyle ( array  $pCellStyle = null,
  $pRange = '' 
)

Duplicate conditional style to a range of cells.

Please note that this will overwrite existing cell styles for cells in range!

@param      array of PHPExcel_Style_Conditional     $pCellStyle     Cell style to duplicate
Parameters
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1581 of file Worksheet.php.

1582 {
1583 foreach($pCellStyle as $cellStyle) {
1584 if (!($cellStyle instanceof PHPExcel_Style_Conditional)) {
1585 throw new PHPExcel_Exception('Style is not a conditional style');
1586 }
1587 }
1588
1589 // Calculate range outer borders
1590 list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange);
1591
1592 // Make sure we can loop upwards on rows and columns
1593 if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
1594 $tmp = $rangeStart;
1595 $rangeStart = $rangeEnd;
1596 $rangeEnd = $tmp;
1597 }
1598
1599 // Loop through cells and apply styles
1600 for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
1601 for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
1602 $this->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row, $pCellStyle);
1603 }
1604 }
1605
1606 return $this;
1607 }
static rangeBoundaries($pRange='A1:A1')
Calculate range boundaries.
Definition: Cell.php:707
setConditionalStyles($pCoordinate='A1', $pValue)
Set conditional styles.
Definition: Worksheet.php:1482

References $row, PHPExcel_Cell\rangeBoundaries(), setConditionalStyles(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ duplicateStyle()

PHPExcel_Worksheet::duplicateStyle ( PHPExcel_Style  $pCellStyle = null,
  $pRange = '' 
)

Duplicate cell style to a range of cells.

Please note that this will overwrite existing cell styles for cells in range!

Parameters
PHPExcel_Style$pCellStyleCell style to duplicate
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1535 of file Worksheet.php.

1536 {
1537 // make sure we have a real style and not supervisor
1538 $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle;
1539
1540 // Add the style to the workbook if necessary
1541 $workbook = $this->_parent;
1542 if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
1543 // there is already such cell Xf in our collection
1544 $xfIndex = $existingStyle->getIndex();
1545 } else {
1546 // we don't have such a cell Xf, need to add
1547 $workbook->addCellXf($pCellStyle);
1548 $xfIndex = $pCellStyle->getIndex();
1549 }
1550
1551 // Calculate range outer borders
1552 list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange);
1553
1554 // Make sure we can loop upwards on rows and columns
1555 if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
1556 $tmp = $rangeStart;
1557 $rangeStart = $rangeEnd;
1558 $rangeEnd = $tmp;
1559 }
1560
1561 // Loop through cells and apply styles
1562 for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
1563 for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
1564 $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row)->setXfIndex($xfIndex);
1565 }
1566 }
1567
1568 return $this;
1569 }
getIsSupervisor()
Is this a supervisor or a cell style component?
Definition: Supervisor.php:82
getSharedComponent()
Get the shared style component for the currently active cell in currently active sheet.
Definition: Style.php:142
getHashCode()
Get hash code.
Definition: Style.php:628
getIndex()
Get own index in style collection.
Definition: Style.php:653
$style
Definition: example_012.php:70

References $_parent, $row, $style, getCell(), PHPExcel_Cell\rangeBoundaries(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by setSharedStyle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateStyleArray()

PHPExcel_Worksheet::duplicateStyleArray (   $pStyles = null,
  $pRange = '',
  $pAdvanced = true 
)

Duplicate cell style array to a range of cells.

Please note that this will overwrite existing cell styles for cells in range, if they are in the styles array. For example, if you decide to set a range of cells to font bold, only include font bold in the styles array.

Deprecated:
Parameters
array$pStylesArray containing style information
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
boolean$pAdvancedAdvanced mode for setting borders.
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1623 of file Worksheet.php.

1624 {
1625 $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced);
1626 return $this;
1627 }
getStyle($pCellCoordinate='A1')
Get style for cell.
Definition: Worksheet.php:1413

References getStyle().

+ Here is the call graph for this function:

◆ extractSheetTitle()

static PHPExcel_Worksheet::extractSheetTitle (   $pRange,
  $returnRange = false 
)
static

Extract worksheet title from range.

Example: extractSheetTitle("testSheet!A1") ==> 'A1' Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1');

Parameters
string$pRangeRange to extract title from
bool$returnRangeReturn range? (see example)
Returns
mixed

Definition at line 2654 of file Worksheet.php.

2654 {
2655 // Sheet title included?
2656 if (($sep = strpos($pRange, '!')) === false) {
2657 return '';
2658 }
2659
2660 if ($returnRange) {
2661 return array( trim(substr($pRange, 0, $sep),"'"),
2662 substr($pRange, $sep + 1)
2663 );
2664 }
2665
2666 return substr($pRange, $sep + 1);
2667 }

Referenced by cellExists(), PHPExcel_Calculation\extractCellRange(), PHPExcel_Calculation\extractNamedRange(), getCell(), and PHPExcel_Reader_Excel2007\load().

+ Here is the caller graph for this function:

◆ freezePane()

PHPExcel_Worksheet::freezePane (   $pCell = '')

Freeze Pane.

Parameters
string$pCellCell (i.e. A2) Examples: A2 will freeze the rows above cell A2 (i.e row 1) B1 will freeze the columns to the left of cell B1 (i.e column A) B2 will freeze the rows above and to the left of cell A2 (i.e row 1 and column A)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1969 of file Worksheet.php.

1970 {
1971 // Uppercase coordinate
1972 $pCell = strtoupper($pCell);
1973
1974 if (strpos($pCell,':') === false && strpos($pCell,',') === false) {
1975 $this->_freezePane = $pCell;
1976 } else {
1977 throw new PHPExcel_Exception('Freeze pane can not be set on a range of cells.');
1978 }
1979 return $this;
1980 }

Referenced by freezePaneByColumnAndRow(), and unfreezePane().

+ Here is the caller graph for this function:

◆ freezePaneByColumnAndRow()

PHPExcel_Worksheet::freezePaneByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Freeze Pane by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1990 of file Worksheet.php.

1991 {
1992 return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
1993 }
freezePane($pCell='')
Freeze Pane.
Definition: Worksheet.php:1969

References freezePane(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ fromArray()

PHPExcel_Worksheet::fromArray (   $source = null,
  $nullValue = null,
  $startCell = 'A1',
  $strictNullComparison = false 
)

Fill worksheet from values in array.

Parameters
array$sourceSource array
mixed$nullValueValue in source array that stands for blank cell
string$startCellInsert array starting from this cell address as the top left coordinate
boolean$strictNullComparisonApply strict comparison when testing for null values in the array
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2405 of file Worksheet.php.

2405 {
2406 if (is_array($source)) {
2407 // Convert a 1-D array to 2-D (for ease of looping)
2408 if (!is_array(end($source))) {
2409 $source = array($source);
2410 }
2411
2412 // start coordinate
2413 list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell);
2414
2415 // Loop through $source
2416 foreach ($source as $rowData) {
2417 $currentColumn = $startColumn;
2418 foreach($rowData as $cellValue) {
2419 if ($strictNullComparison) {
2420 if ($cellValue !== $nullValue) {
2421 // Set cell value
2422 $this->getCell($currentColumn . $startRow)->setValue($cellValue);
2423 }
2424 } else {
2425 if ($cellValue != $nullValue) {
2426 // Set cell value
2427 $this->getCell($currentColumn . $startRow)->setValue($cellValue);
2428 }
2429 }
2430 ++$currentColumn;
2431 }
2432 ++$startRow;
2433 }
2434 } else {
2435 throw new PHPExcel_Exception("Parameter \$source should be an array.");
2436 }
2437 return $this;
2438 }

References PHPExcel_Cell\coordinateFromString(), and getCell().

+ Here is the call graph for this function:

◆ garbageCollect()

PHPExcel_Worksheet::garbageCollect ( )

Run PHPExcel garabage collector.

Returns
PHPExcel_Worksheet

Definition at line 2588 of file Worksheet.php.

2588 {
2589 // Flush cache
2590 $this->_cellCollection->getCacheData('A1');
2591 // Build a reference table from images
2592// $imageCoordinates = array();
2593// $iterator = $this->getDrawingCollection()->getIterator();
2594// while ($iterator->valid()) {
2595// $imageCoordinates[$iterator->current()->getCoordinates()] = true;
2596//
2597// $iterator->next();
2598// }
2599//
2600 // Lookup highest column and highest row if cells are cleaned
2601 $colRow = $this->_cellCollection->getHighestRowAndColumn();
2602 $highestRow = $colRow['row'];
2603 $highestColumn = PHPExcel_Cell::columnIndexFromString($colRow['column']);
2604
2605 // Loop through column dimensions
2606 foreach ($this->_columnDimensions as $dimension) {
2607 $highestColumn = max($highestColumn,PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex()));
2608 }
2609
2610 // Loop through row dimensions
2611 foreach ($this->_rowDimensions as $dimension) {
2612 $highestRow = max($highestRow,$dimension->getRowIndex());
2613 }
2614
2615 // Cache values
2616 if ($highestColumn < 0) {
2617 $this->_cachedHighestColumn = 'A';
2618 } else {
2619 $this->_cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn);
2620 }
2621 $this->_cachedHighestRow = $highestRow;
2622
2623 // Return
2624 return $this;
2625 }

References PHPExcel_Cell\columnIndexFromString(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by toArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveCell()

PHPExcel_Worksheet::getActiveCell ( )

Get active cell.

Returns
string Example: 'A1'

Definition at line 2302 of file Worksheet.php.

2303 {
2304 return $this->_activeCell;
2305 }

References $_activeCell.

◆ getAutoFilter()

PHPExcel_Worksheet::getAutoFilter ( )

Get Autofilter.

Returns
PHPExcel_Worksheet_AutoFilter

Definition at line 1892 of file Worksheet.php.

1893 {
1894 return $this->_autoFilter;
1895 }

References $_autoFilter.

◆ getBreaks()

PHPExcel_Worksheet::getBreaks ( )

Get breaks.

Returns
array[]

Definition at line 1675 of file Worksheet.php.

1676 {
1677 return $this->_breaks;
1678 }

References $_breaks.

Referenced by PHPExcel_ReferenceHelper\_adjustPageBreaks(), and PHPExcel_Writer_HTML\_generateRow().

+ Here is the caller graph for this function:

◆ getCell()

PHPExcel_Worksheet::getCell (   $pCoordinate = 'A1')

Get cell at a specific coordinate.

Parameters
string$pCoordinateCoordinate of the cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Cell Cell that was found

Definition at line 1153 of file Worksheet.php.

1154 {
1155 $pCoordinate = strtoupper($pCoordinate);
1156 // Check cell collection
1157 if ($this->_cellCollection->isDataSet($pCoordinate)) {
1158 return $this->_cellCollection->getCacheData($pCoordinate);
1159 }
1160
1161 // Worksheet reference?
1162 if (strpos($pCoordinate, '!') !== false) {
1163 $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
1164 return $this->_parent->getSheetByName($worksheetReference[0])->getCell($worksheetReference[1]);
1165 }
1166
1167 // Named range?
1168 if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
1169 (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
1170 $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
1171 if ($namedRange !== NULL) {
1172 $pCoordinate = $namedRange->getRange();
1173 return $namedRange->getWorksheet()->getCell($pCoordinate);
1174 }
1175 }
1176
1177 // Uppercase coordinate
1178 $pCoordinate = strtoupper($pCoordinate);
1179
1180 if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
1181 throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.');
1182 } elseif (strpos($pCoordinate, '$') !== false) {
1183 throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
1184 }
1185
1186 // Create new cell object
1187 return $this->_createNewCell($pCoordinate);
1188 }
_createNewCell($pCoordinate)
Create a new cell at the specified coordinate.
Definition: Worksheet.php:1215

References _createNewCell(), PHPExcel_Calculation\CALCULATION_REGEXP_CELLREF, PHPExcel_Calculation\CALCULATION_REGEXP_NAMEDRANGE, extractSheetTitle(), and PHPExcel_NamedRange\resolveRange().

Referenced by PHPExcel_Writer_HTML\_generateRow(), PHPExcel\addExternalSheet(), calculateColumnWidths(), duplicateStyle(), fromArray(), mergeCells(), setCellValue(), and setCellValueExplicit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCellByColumnAndRow()

PHPExcel_Worksheet::getCellByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Get cell at a specific coordinate by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
Returns
PHPExcel_Cell Cell that was found

Definition at line 1197 of file Worksheet.php.

1198 {
1199 $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn);
1200 $coordinate = $columnLetter . $pRow;
1201
1202 if ($this->_cellCollection->isDataSet($coordinate)) {
1203 return $this->_cellCollection->getCacheData($coordinate);
1204 }
1205
1206 return $this->_createNewCell($coordinate);
1207 }

References _createNewCell(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by setCellValueByColumnAndRow(), and setCellValueExplicitByColumnAndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCellCacheController()

PHPExcel_Worksheet::getCellCacheController ( )

Return the cache controller for the cell collection.

Returns
PHPExcel_CachedObjectStorage_xxx

Definition at line 413 of file Worksheet.php.

413 {
415 } // function getCellCacheController()

References $_cellCollection.

Referenced by PHPExcel_Cell\rebindParent(), removeColumn(), and removeRow().

+ Here is the caller graph for this function:

◆ getCellCollection()

PHPExcel_Worksheet::getCellCollection (   $pSorted = true)

Get collection of cells.

Parameters
boolean$pSortedAlso sort the cell collection?
Returns
PHPExcel_Cell[]

Definition at line 484 of file Worksheet.php.

485 {
486 if ($pSorted) {
487 // Re-order cell collection
488 return $this->sortCellCollection();
489 }
490 if ($this->_cellCollection !== NULL) {
491 return $this->_cellCollection->getCellList();
492 }
493 return array();
494 }
sortCellCollection()
Sort collection of cells.
Definition: Worksheet.php:501

References sortCellCollection().

Referenced by PHPExcel\addExternalSheet(), and calculateColumnWidths().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChartByIndex()

PHPExcel_Worksheet::getChartByIndex (   $index = null)

Get a chart by its index position.

Parameters
string$indexChart index position
Returns
false|PHPExcel_Chart
Exceptions
PHPExcel_Exception

Definition at line 606 of file Worksheet.php.

607 {
608 $chartCount = count($this->_chartCollection);
609 if ($chartCount == 0) {
610 return false;
611 }
612 if (is_null($index)) {
613 $index = --$chartCount;
614 }
615 if (!isset($this->_chartCollection[$index])) {
616 return false;
617 }
618
619 return $this->_chartCollection[$index];
620 }

◆ getChartByName()

PHPExcel_Worksheet::getChartByName (   $chartName = '')

Get a chart by name.

Parameters
string$chartNameChart name
Returns
false|PHPExcel_Chart
Exceptions
PHPExcel_Exception

Definition at line 644 of file Worksheet.php.

645 {
646 $chartCount = count($this->_chartCollection);
647 if ($chartCount == 0) {
648 return false;
649 }
650 foreach($this->_chartCollection as $index => $chart) {
651 if ($chart->getName() == $chartName) {
652 return $this->_chartCollection[$index];
653 }
654 }
655 return false;
656 }

References $chart.

◆ getChartCollection()

PHPExcel_Worksheet::getChartCollection ( )

Get collection of charts.

Returns
PHPExcel_Chart[]

Definition at line 564 of file Worksheet.php.

565 {
567 }

References $_chartCollection.

Referenced by PHPExcel_Writer_HTML\_extendRowsForChartsAndImages(), and PHPExcel_Writer_HTML\_writeChartInCell().

+ Here is the caller graph for this function:

◆ getChartCount()

PHPExcel_Worksheet::getChartCount ( )

Return the count of charts on this worksheet.

Returns
int The number of charts

Definition at line 594 of file Worksheet.php.

595 {
596 return count($this->_chartCollection);
597 }

◆ getChartNames()

PHPExcel_Worksheet::getChartNames ( )

Return an array of the names of charts on this worksheet.

Returns
string[] The names of charts
Exceptions
PHPExcel_Exception

Definition at line 628 of file Worksheet.php.

629 {
630 $chartNames = array();
631 foreach($this->_chartCollection as $chart) {
632 $chartNames[] = $chart->getName();
633 }
634 return $chartNames;
635 }

References $chart.

◆ getCodeName()

PHPExcel_Worksheet::getCodeName ( )

Return the code name of the sheet.

Returns
null|string

Definition at line 2935 of file Worksheet.php.

2935 {
2936 return $this->_codeName;
2937 }

References $_codeName.

Referenced by setCodeName().

+ Here is the caller graph for this function:

◆ getColumnDimension()

PHPExcel_Worksheet::getColumnDimension (   $pColumn = 'A',
  $create = TRUE 
)

Get column dimension at a specific column.

Parameters
string$pColumnString index of the column
Returns
PHPExcel_Worksheet_ColumnDimension

Definition at line 1337 of file Worksheet.php.

1338 {
1339 // Uppercase coordinate
1340 $pColumn = strtoupper($pColumn);
1341
1342 // Fetch dimensions
1343 if (!isset($this->_columnDimensions[$pColumn])) {
1344 if (!$create)
1345 return NULL;
1346 $this->_columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn);
1347
1348 if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn))
1349 $this->_cachedHighestColumn = $pColumn;
1350 }
1351 return $this->_columnDimensions[$pColumn];
1352 }

References PHPExcel_Cell\columnIndexFromString().

Referenced by _createNewCell(), calculateColumnWidths(), and getColumnDimensionByColumn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumnDimensionByColumn()

PHPExcel_Worksheet::getColumnDimensionByColumn (   $pColumn = 0)

Get column dimension at a specific column by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
Returns
PHPExcel_Worksheet_ColumnDimension

Definition at line 1360 of file Worksheet.php.

1361 {
1363 }

References getColumnDimension(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ getColumnDimensions()

PHPExcel_Worksheet::getColumnDimensions ( )

Get collection of column dimensions.

Returns
PHPExcel_Worksheet_ColumnDimension[]

Definition at line 534 of file Worksheet.php.

535 {
537 }

References $_columnDimensions.

Referenced by calculateColumnWidths(), and refreshColumnDimensions().

+ Here is the caller graph for this function:

◆ getColumnIterator()

PHPExcel_Worksheet::getColumnIterator (   $startColumn = 'A',
  $endColumn = null 
)

Get column iterator.

Parameters
string$startColumnThe column address at which to start iterating
string$endColumnThe column address at which to stop iterating
Returns
PHPExcel_Worksheet_ColumnIterator

Definition at line 2579 of file Worksheet.php.

2579 {
2580 return new PHPExcel_Worksheet_ColumnIterator($this, $startColumn, $endColumn);
2581 }

◆ getComment()

PHPExcel_Worksheet::getComment (   $pCellCoordinate = 'A1')

Get comment for cell.

Parameters
string$pCellCoordinateCell coordinate to get comment for
Returns
PHPExcel_Comment
Exceptions
PHPExcel_Exception

Definition at line 2250 of file Worksheet.php.

2251 {
2252 // Uppercase coordinate
2253 $pCellCoordinate = strtoupper($pCellCoordinate);
2254
2255 if (strpos($pCellCoordinate,':') !== false || strpos($pCellCoordinate,',') !== false) {
2256 throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells.');
2257 } else if (strpos($pCellCoordinate,'$') !== false) {
2258 throw new PHPExcel_Exception('Cell coordinate string must not be absolute.');
2259 } else if ($pCellCoordinate == '') {
2260 throw new PHPExcel_Exception('Cell coordinate can not be zero-length string.');
2261 } else {
2262 // Check if we already have a comment for this cell.
2263 // If not, create a new comment.
2264 if (isset($this->_comments[$pCellCoordinate])) {
2265 return $this->_comments[$pCellCoordinate];
2266 } else {
2267 $newComment = new PHPExcel_Comment();
2268 $this->_comments[$pCellCoordinate] = $newComment;
2269 return $newComment;
2270 }
2271 }
2272 }

Referenced by getCommentByColumnAndRow().

+ Here is the caller graph for this function:

◆ getCommentByColumnAndRow()

PHPExcel_Worksheet::getCommentByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Get comment for cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Returns
PHPExcel_Comment

Definition at line 2281 of file Worksheet.php.

2282 {
2283 return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
2284 }
getComment($pCellCoordinate='A1')
Get comment for cell.
Definition: Worksheet.php:2250

References getComment(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ getComments()

PHPExcel_Worksheet::getComments ( )

Get comments.

Returns
PHPExcel_Comment[]

Definition at line 2225 of file Worksheet.php.

2226 {
2227 return $this->_comments;
2228 }

References $_comments.

◆ getConditionalStyles()

PHPExcel_Worksheet::getConditionalStyles (   $pCoordinate = 'A1')

Get conditional styles for a cell.

Parameters
string$pCoordinate
Returns
PHPExcel_Style_Conditional[]

Definition at line 1430 of file Worksheet.php.

1431 {
1432 $pCoordinate = strtoupper($pCoordinate);
1433 if (!isset($this->_conditionalStylesCollection[$pCoordinate])) {
1434 $this->_conditionalStylesCollection[$pCoordinate] = array();
1435 }
1436 return $this->_conditionalStylesCollection[$pCoordinate];
1437 }

◆ getConditionalStylesCollection()

PHPExcel_Worksheet::getConditionalStylesCollection ( )

Get collection of conditional styles.

Returns
array

Definition at line 1470 of file Worksheet.php.

1471 {
1473 }

References $_conditionalStylesCollection.

◆ getDataValidation()

PHPExcel_Worksheet::getDataValidation (   $pCellCoordinate = 'A1')

Get data validation.

Parameters
string$pCellCoordinateCell coordinate to get data validation for

Definition at line 2729 of file Worksheet.php.

2730 {
2731 // return data validation if we already have one
2732 if (isset($this->_dataValidationCollection[$pCellCoordinate])) {
2733 return $this->_dataValidationCollection[$pCellCoordinate];
2734 }
2735
2736 // else create data validation
2737 $this->_dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation();
2738 return $this->_dataValidationCollection[$pCellCoordinate];
2739 }

◆ getDataValidationCollection()

PHPExcel_Worksheet::getDataValidationCollection ( )

Get collection of data validations.

Returns
PHPExcel_Cell_DataValidation[]

Definition at line 2774 of file Worksheet.php.

2775 {
2777 }

References $_dataValidationCollection.

◆ getDefaultColumnDimension()

PHPExcel_Worksheet::getDefaultColumnDimension ( )

Get default column dimension.

Returns
PHPExcel_Worksheet_ColumnDimension

Definition at line 544 of file Worksheet.php.

545 {
547 }

References $_defaultColumnDimension.

Referenced by calculateColumnWidths().

+ Here is the caller graph for this function:

◆ getDefaultRowDimension()

PHPExcel_Worksheet::getDefaultRowDimension ( )

Get default row dimension.

Returns
PHPExcel_Worksheet_RowDimension

Definition at line 524 of file Worksheet.php.

525 {
527 }

References $_defaultRowDimension.

◆ getDefaultStyle()

PHPExcel_Worksheet::getDefaultStyle ( )

Get default style of workbook.

Deprecated:
Returns
PHPExcel_Style
Exceptions
PHPExcel_Exception

Definition at line 1382 of file Worksheet.php.

1383 {
1384 return $this->_parent->getDefaultStyle();
1385 }

◆ getDrawingCollection()

PHPExcel_Worksheet::getDrawingCollection ( )

Get collection of drawings.

Returns
PHPExcel_Worksheet_BaseDrawing[]

Definition at line 554 of file Worksheet.php.

555 {
557 }

References $_drawingCollection.

Referenced by PHPExcel_Writer_HTML\_extendRowsForChartsAndImages(), and PHPExcel_Writer_HTML\_writeImageInCell().

+ Here is the caller graph for this function:

◆ getFreezePane()

PHPExcel_Worksheet::getFreezePane ( )

Get Freeze Pane.

Returns
string

Definition at line 1952 of file Worksheet.php.

1953 {
1954 return $this->_freezePane;
1955 }

References $_freezePane.

◆ getHashCode()

PHPExcel_Worksheet::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 2632 of file Worksheet.php.

2632 {
2633 if ($this->_dirty) {
2634 $this->_hash = md5( $this->_title .
2635 $this->_autoFilter .
2636 ($this->_protection->isProtectionEnabled() ? 't' : 'f') .
2637 __CLASS__
2638 );
2639 $this->_dirty = false;
2640 }
2641 return $this->_hash;
2642 }

References $_hash.

Referenced by cellExists(), and PHPExcel\getIndex().

+ Here is the caller graph for this function:

◆ getHeaderFooter()

PHPExcel_Worksheet::getHeaderFooter ( )

Get page header/footer.

Returns
PHPExcel_Worksheet_HeaderFooter

Definition at line 958 of file Worksheet.php.

959 {
961 }

References $_headerFooter.

◆ getHighestColumn()

PHPExcel_Worksheet::getHighestColumn (   $row = null)

Get highest worksheet column.

Parameters
string$rowReturn the data highest column for the specified row, or the highest column of any row if no row number is passed
Returns
string Highest column name

Definition at line 1028 of file Worksheet.php.

1029 {
1030 if ($row == null) {
1032 }
1033 return $this->getHighestDataColumn($row);
1034 }

References $_cachedHighestColumn, $row, and getHighestDataColumn().

Referenced by calculateWorksheetDimension(), shrinkRangeToFit(), and toArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHighestDataColumn()

PHPExcel_Worksheet::getHighestDataColumn (   $row = null)

Get highest worksheet column that contains data.

Parameters
string$rowReturn the highest data column for the specified row, or the highest data column of any row if no row number is passed
Returns
string Highest column name that contains data

Definition at line 1043 of file Worksheet.php.

1044 {
1045 return $this->_cellCollection->getHighestColumn($row);
1046 }

References $row.

Referenced by calculateWorksheetDataDimension(), getHighestColumn(), and removeColumn().

+ Here is the caller graph for this function:

◆ getHighestDataRow()

PHPExcel_Worksheet::getHighestDataRow (   $column = null)

Get highest worksheet row that contains data.

Parameters
string$columnReturn the highest data row for the specified column, or the highest data row of any column if no column letter is passed
Returns
string Highest row number that contains data

Definition at line 1070 of file Worksheet.php.

1071 {
1072 return $this->_cellCollection->getHighestRow($column);
1073 }
$column
Definition: 39dropdown.php:62

References $column.

Referenced by calculateWorksheetDataDimension(), getHighestRow(), and removeRow().

+ Here is the caller graph for this function:

◆ getHighestRow()

PHPExcel_Worksheet::getHighestRow (   $column = null)

Get highest worksheet row.

Parameters
string$columnReturn the highest data row for the specified column, or the highest row of any column if no column letter is passed
Returns
int Highest row number

Definition at line 1055 of file Worksheet.php.

1056 {
1057 if ($column == null) {
1059 }
1060 return $this->getHighestDataRow($column);
1061 }

References $_cachedHighestRow, $column, and getHighestDataRow().

Referenced by calculateWorksheetDimension(), shrinkRangeToFit(), and toArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHighestRowAndColumn()

PHPExcel_Worksheet::getHighestRowAndColumn ( )

Get highest worksheet column and highest row that have cell records.

Returns
array Highest column name and highest row number

Definition at line 1080 of file Worksheet.php.

1081 {
1082 return $this->_cellCollection->getHighestRowAndColumn();
1083 }

◆ getHyperlink()

PHPExcel_Worksheet::getHyperlink (   $pCellCoordinate = 'A1')

Get hyperlink.

Parameters
string$pCellCoordinateCell coordinate to get hyperlink for

Definition at line 2674 of file Worksheet.php.

2675 {
2676 // return hyperlink if we already have one
2677 if (isset($this->_hyperlinkCollection[$pCellCoordinate])) {
2678 return $this->_hyperlinkCollection[$pCellCoordinate];
2679 }
2680
2681 // else create hyperlink
2682 $this->_hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink();
2683 return $this->_hyperlinkCollection[$pCellCoordinate];
2684 }

Referenced by PHPExcel_Writer_HTML\_generateRow().

+ Here is the caller graph for this function:

◆ getHyperlinkCollection()

PHPExcel_Worksheet::getHyperlinkCollection ( )

Get collection of hyperlinks.

Returns
PHPExcel_Cell_Hyperlink[]

Definition at line 2719 of file Worksheet.php.

2720 {
2722 }

References $_hyperlinkCollection.

◆ getInvalidCharacters()

static PHPExcel_Worksheet::getInvalidCharacters ( )
static

Get array of invalid characters for sheet title.

Returns
array

Definition at line 423 of file Worksheet.php.

424 {
426 }
static $_invalidCharacters
Definition: Worksheet.php:53

References $_invalidCharacters.

◆ getMergeCells()

PHPExcel_Worksheet::getMergeCells ( )

Get merge cells array.

Returns
array[]

Definition at line 1781 of file Worksheet.php.

1782 {
1783 return $this->_mergeCells;
1784 }

References $_mergeCells.

Referenced by calculateColumnWidths().

+ Here is the caller graph for this function:

◆ getPageMargins()

PHPExcel_Worksheet::getPageMargins ( )

Get page margins.

Returns
PHPExcel_Worksheet_PageMargins

Definition at line 936 of file Worksheet.php.

937 {
938 return $this->_pageMargins;
939 }

References $_pageMargins.

Referenced by PHPExcel_Writer_HTML\_setMargins().

+ Here is the caller graph for this function:

◆ getPageSetup()

PHPExcel_Worksheet::getPageSetup ( )

Get page setup.

Returns
PHPExcel_Worksheet_PageSetup

Definition at line 914 of file Worksheet.php.

915 {
916 return $this->_pageSetup;
917 }

References $_pageSetup.

◆ getParent()

PHPExcel_Worksheet::getParent ( )

Get parent.

Returns
PHPExcel

Definition at line 786 of file Worksheet.php.

786 {
787 return $this->_parent;
788 }

References $_parent.

Referenced by PHPExcel_Writer_HTML\_generateRow(), PHPExcel\addExternalSheet(), PHPExcel\addSheet(), PHPExcel_NamedRange\resolveRange(), and setCodeName().

+ Here is the caller graph for this function:

◆ getPrintGridlines()

PHPExcel_Worksheet::getPrintGridlines ( )

Print gridlines?

Returns
boolean

Definition at line 2145 of file Worksheet.php.

2145 {
2147 }

References $_printGridlines.

◆ getProtectedCells()

PHPExcel_Worksheet::getProtectedCells ( )

Get protected cells.

Returns
array[]

Definition at line 1882 of file Worksheet.php.

1883 {
1885 }

References $_protectedCells.

◆ getProtection()

PHPExcel_Worksheet::getProtection ( )

Get Protection.

Returns
PHPExcel_Worksheet_Protection

Definition at line 1002 of file Worksheet.php.

1003 {
1004 return $this->_protection;
1005 }

References $_protection.

◆ getRightToLeft()

PHPExcel_Worksheet::getRightToLeft ( )

Get right-to-left.

Returns
boolean

Definition at line 2380 of file Worksheet.php.

2380 {
2381 return $this->_rightToLeft;
2382 }

References $_rightToLeft.

◆ getRowDimension()

PHPExcel_Worksheet::getRowDimension (   $pRow = 1,
  $create = TRUE 
)

Get row dimension at a specific row.

Parameters
int$pRowNumeric index of the row
Returns
PHPExcel_Worksheet_RowDimension

Definition at line 1315 of file Worksheet.php.

1316 {
1317 // Found
1318 $found = null;
1319
1320 // Get row dimension
1321 if (!isset($this->_rowDimensions[$pRow])) {
1322 if (!$create)
1323 return NULL;
1324 $this->_rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow);
1325
1326 $this->_cachedHighestRow = max($this->_cachedHighestRow,$pRow);
1327 }
1328 return $this->_rowDimensions[$pRow];
1329 }

Referenced by _createNewCell().

+ Here is the caller graph for this function:

◆ getRowDimensions()

PHPExcel_Worksheet::getRowDimensions ( )

Get collection of row dimensions.

Returns
PHPExcel_Worksheet_RowDimension[]

Definition at line 514 of file Worksheet.php.

515 {
517 }

References $_rowDimensions.

Referenced by refreshRowDimensions().

+ Here is the caller graph for this function:

◆ getRowIterator()

PHPExcel_Worksheet::getRowIterator (   $startRow = 1,
  $endRow = null 
)

Get row iterator.

Parameters
integer$startRowThe row number at which to start iterating
integer$endRowThe row number at which to stop iterating
Returns
PHPExcel_Worksheet_RowIterator

Definition at line 2567 of file Worksheet.php.

2567 {
2568 return new PHPExcel_Worksheet_RowIterator($this, $startRow, $endRow);
2569 }

Referenced by PHPExcel_Writer_OpenDocument_Content\_writeRows().

+ Here is the caller graph for this function:

◆ getSelectedCell()

PHPExcel_Worksheet::getSelectedCell ( )

Get selected cell.

Deprecated:
Returns
string

Definition at line 2292 of file Worksheet.php.

2293 {
2294 return $this->getSelectedCells();
2295 }
getSelectedCells()
Get selected cells.
Definition: Worksheet.php:2312

References getSelectedCells().

+ Here is the call graph for this function:

◆ getSelectedCells()

PHPExcel_Worksheet::getSelectedCells ( )

Get selected cells.

Returns
string

Definition at line 2312 of file Worksheet.php.

2313 {
2314 return $this->_selectedCells;
2315 }

References $_selectedCells.

Referenced by getSelectedCell().

+ Here is the caller graph for this function:

◆ getSheetState()

PHPExcel_Worksheet::getSheetState ( )

Get sheet state.

Returns
string Sheet state (visible, hidden, veryHidden)

Definition at line 894 of file Worksheet.php.

894 {
895 return $this->_sheetState;
896 }

References $_sheetState.

◆ getSheetView()

PHPExcel_Worksheet::getSheetView ( )

Get sheet view.

Returns
PHPExcel_Worksheet_SheetView

Definition at line 980 of file Worksheet.php.

981 {
982 return $this->_sheetView;
983 }

References $_sheetView.

◆ getShowGridlines()

PHPExcel_Worksheet::getShowGridlines ( )

Show gridlines?

Returns
boolean

Definition at line 2125 of file Worksheet.php.

2125 {
2126 return $this->_showGridlines;
2127 }

References $_showGridlines.

◆ getShowRowColHeaders()

PHPExcel_Worksheet::getShowRowColHeaders ( )

Show row and column headers?

Returns
boolean

Definition at line 2165 of file Worksheet.php.

2165 {
2167 }

References $_showRowColHeaders.

◆ getShowSummaryBelow()

PHPExcel_Worksheet::getShowSummaryBelow ( )

Show summary below? (Row/Column outlining)

Returns
boolean

Definition at line 2185 of file Worksheet.php.

2185 {
2187 }

References $_showSummaryBelow.

◆ getShowSummaryRight()

PHPExcel_Worksheet::getShowSummaryRight ( )

Show summary right? (Row/Column outlining)

Returns
boolean

Definition at line 2205 of file Worksheet.php.

2205 {
2207 }

References $_showSummaryRight.

◆ getStyle()

PHPExcel_Worksheet::getStyle (   $pCellCoordinate = 'A1')

Get style for cell.

Parameters
string$pCellCoordinateCell coordinate (or range) to get style for
Returns
PHPExcel_Style
Exceptions
PHPExcel_Exception

Definition at line 1413 of file Worksheet.php.

1414 {
1415 // set this sheet as active
1416 $this->_parent->setActiveSheetIndex($this->_parent->getIndex($this));
1417
1418 // set cell coordinate as active
1419 $this->setSelectedCells(strtoupper($pCellCoordinate));
1420
1421 return $this->_parent->getCellXfSupervisor();
1422 }
setSelectedCells($pCoordinate='A1')
Select a range of cells.
Definition: Worksheet.php:2335

References setSelectedCells().

Referenced by duplicateStyleArray(), and getStyleByColumnAndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStyleByColumnAndRow()

PHPExcel_Worksheet::getStyleByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pColumn2 = null,
  $pRow2 = null 
)

Get style for cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
intpColumn2 Numeric column coordinate of the range cell
intpRow2 Numeric row coordinate of the range cell
Returns
PHPExcel_Style

Definition at line 1497 of file Worksheet.php.

1498 {
1499 if (!is_null($pColumn2) && !is_null($pRow2)) {
1500 $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' .
1501 PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
1502 return $this->getStyle($cellRange);
1503 }
1504
1505 return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
1506 }

References getStyle(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ getStyles()

PHPExcel_Worksheet::getStyles ( )

Get styles.

Returns
PHPExcel_Style[]

Definition at line 1370 of file Worksheet.php.

1371 {
1372 return $this->_styles;
1373 }

References $_styles.

◆ getTabColor()

PHPExcel_Worksheet::getTabColor ( )

Get tab color.

Returns
PHPExcel_Style_Color

Definition at line 2811 of file Worksheet.php.

2812 {
2813 if ($this->_tabColor === NULL)
2814 $this->_tabColor = new PHPExcel_Style_Color();
2815
2816 return $this->_tabColor;
2817 }

References $_tabColor.

◆ getTitle()

PHPExcel_Worksheet::getTitle ( )

Get title.

Returns
string

Definition at line 817 of file Worksheet.php.

818 {
819 return $this->_title;
820 }

References $_title.

Referenced by __construct(), PHPExcel\addExternalSheet(), PHPExcel\addSheet(), and setTitle().

+ Here is the caller graph for this function:

◆ hasCodeName()

PHPExcel_Worksheet::hasCodeName ( )

Sheet has a code name ?

Returns
boolean

Definition at line 2942 of file Worksheet.php.

2942 {
2943 return !(is_null($this->_codeName));
2944 }

◆ hyperlinkExists()

PHPExcel_Worksheet::hyperlinkExists (   $pCoordinate = 'A1')

Hyperlink at a specific coordinate exists?

Parameters
string$pCoordinate
Returns
boolean

Definition at line 2709 of file Worksheet.php.

2710 {
2711 return isset($this->_hyperlinkCollection[$pCoordinate]);
2712 }

Referenced by PHPExcel_Writer_HTML\_generateRow().

+ Here is the caller graph for this function:

◆ insertNewColumnBefore()

PHPExcel_Worksheet::insertNewColumnBefore (   $pBefore = 'A',
  $pNumCols = 1 
)

Insert a new column, updating all possible related data.

Parameters
int$pBeforeInsert before this one
int$pNumColsNumber of columns to insert
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2031 of file Worksheet.php.

2031 {
2032 if (!is_numeric($pBefore)) {
2033 $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
2034 $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
2035 } else {
2036 throw new PHPExcel_Exception("Column references should not be numeric.");
2037 }
2038 return $this;
2039 }
static getInstance()
Get an instance of this class.

References PHPExcel_ReferenceHelper\getInstance().

Referenced by insertNewColumnBeforeByIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertNewColumnBeforeByIndex()

PHPExcel_Worksheet::insertNewColumnBeforeByIndex (   $pBefore = 0,
  $pNumCols = 1 
)

Insert a new column, updating all possible related data.

Parameters
int$pBeforeInsert before this one (numeric column coordinate of the cell)
int$pNumColsNumber of columns to insert
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2049 of file Worksheet.php.

2049 {
2050 if ($pBefore >= 0) {
2051 return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols);
2052 } else {
2053 throw new PHPExcel_Exception("Columns can only be inserted before at least column A (0).");
2054 }
2055 }
insertNewColumnBefore($pBefore='A', $pNumCols=1)
Insert a new column, updating all possible related data.
Definition: Worksheet.php:2031

References insertNewColumnBefore(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ insertNewRowBefore()

PHPExcel_Worksheet::insertNewRowBefore (   $pBefore = 1,
  $pNumRows = 1 
)

Insert a new row, updating all possible related data.

Parameters
int$pBeforeInsert before this one
int$pNumRowsNumber of rows to insert
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2013 of file Worksheet.php.

2013 {
2014 if ($pBefore >= 1) {
2015 $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
2016 $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
2017 } else {
2018 throw new PHPExcel_Exception("Rows can only be inserted before at least row 1.");
2019 }
2020 return $this;
2021 }

References PHPExcel_ReferenceHelper\getInstance().

+ Here is the call graph for this function:

◆ isTabColorSet()

PHPExcel_Worksheet::isTabColorSet ( )

Tab color set?

Returns
boolean

Definition at line 2837 of file Worksheet.php.

2838 {
2839 return ($this->_tabColor !== NULL);
2840 }

◆ mergeCells()

PHPExcel_Worksheet::mergeCells (   $pRange = 'A1:A1')

Set merge on a cell range.

Parameters
string$pRangeCell range (e.g. A1:E1)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1687 of file Worksheet.php.

1687 :A1')
1688 {
1689 // Uppercase coordinate
1690 $pRange = strtoupper($pRange);
1691
1692 if (strpos($pRange,':') !== false) {
1693 $this->_mergeCells[$pRange] = $pRange;
1694
1695 // make sure cells are created
1696
1697 // get the cells in the range
1698 $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
1699
1700 // create upper left cell if it does not already exist
1701 $upperLeft = $aReferences[0];
1702 if (!$this->cellExists($upperLeft)) {
1703 $this->getCell($upperLeft)->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL);
1704 }
1705
1706 // create or blank out the rest of the cells in the range
1707 $count = count($aReferences);
1708 for ($i = 1; $i < $count; $i++) {
1709 $this->getCell($aReferences[$i])->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL);
1710 }
1711
1712 } else {
1713 throw new PHPExcel_Exception('Merge must be set on a range of cells.');
1714 }
1715
1716 return $this;
1717 }

References cellExists(), PHPExcel_Cell\extractAllCellReferencesInRange(), getCell(), and PHPExcel_Cell_DataType\TYPE_NULL.

Referenced by mergeCellsByColumnAndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mergeCellsByColumnAndRow()

PHPExcel_Worksheet::mergeCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1 
)

Set merge on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1729 of file Worksheet.php.

1730 {
1731 $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
1732 return $this->mergeCells($cellRange);
1733 }
mergeCells($pRange='A1:A1')
Set merge on a cell range.
Definition: Worksheet.php:1687

References mergeCells(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ namedRangeToArray()

PHPExcel_Worksheet::namedRangeToArray (   $pNamedRange = '',
  $nullValue = null,
  $calculateFormulas = true,
  $formatData = true,
  $returnCellRef = false 
)

Create array from a range of cells.

Parameters
string$pNamedRangeName of the Named Range
mixed$nullValueValue returned in the array entry if a cell doesn't exist
boolean$calculateFormulasShould formulas be calculated?
boolean$formatDataShould formatting be applied to cell values?
boolean$returnCellRefFalse - Return a simple array of rows and columns indexed by number counting from zero True - Return rows and columns indexed by their actual row and column IDs
Returns
array
Exceptions
PHPExcel_Exception

Definition at line 2523 of file Worksheet.php.

2523 {
2524 $namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this);
2525 if ($namedRange !== NULL) {
2526 $pWorkSheet = $namedRange->getWorksheet();
2527 $pCellRange = $namedRange->getRange();
2528
2529 return $pWorkSheet->rangeToArray( $pCellRange,
2530 $nullValue, $calculateFormulas, $formatData, $returnCellRef);
2531 }
2532
2533 throw new PHPExcel_Exception('Named Range '.$pNamedRange.' does not exist.');
2534 }

References PHPExcel_NamedRange\resolveRange().

+ Here is the call graph for this function:

◆ protectCells()

PHPExcel_Worksheet::protectCells (   $pRange = 'A1',
  $pPassword = '',
  $pAlreadyHashed = false 
)

Set protection on a cell range.

Parameters
string$pRangeCell (e.g. A1) or cell range (e.g. A1:E1)
string$pPasswordPassword to unlock the protection
boolean$pAlreadyHashedIf the password has already been hashed, set this to true
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1808 of file Worksheet.php.

1809 {
1810 // Uppercase coordinate
1811 $pRange = strtoupper($pRange);
1812
1813 if (!$pAlreadyHashed) {
1814 $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword);
1815 }
1816 $this->_protectedCells[$pRange] = $pPassword;
1817
1818 return $this;
1819 }
static hashPassword($pPassword='')
Create a password hash from a given string.

References PHPExcel_Shared_PasswordHasher\hashPassword().

Referenced by protectCellsByColumnAndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ protectCellsByColumnAndRow()

PHPExcel_Worksheet::protectCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1,
  $pPassword = '',
  $pAlreadyHashed = false 
)

Set protection on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
string$pPasswordPassword to unlock the protection
boolean$pAlreadyHashedIf the password has already been hashed, set this to true
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1833 of file Worksheet.php.

1834 {
1835 $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
1836 return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed);
1837 }
protectCells($pRange='A1', $pPassword='', $pAlreadyHashed=false)
Set protection on a cell range.
Definition: Worksheet.php:1808

References protectCells(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ rangeToArray()

PHPExcel_Worksheet::rangeToArray (   $pRange = 'A1',
  $nullValue = null,
  $calculateFormulas = true,
  $formatData = true,
  $returnCellRef = false 
)

Create array from a range of cells.

Parameters
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
mixed$nullValueValue returned in the array entry if a cell doesn't exist
boolean$calculateFormulasShould formulas be calculated?
boolean$formatDataShould formatting be applied to cell values?
boolean$returnCellRefFalse - Return a simple array of rows and columns indexed by number counting from zero True - Return rows and columns indexed by their actual row and column IDs
Returns
array

Definition at line 2451 of file Worksheet.php.

2451 {
2452 // Returnvalue
2453 $returnValue = array();
2454 // Identify the range that we need to extract from the worksheet
2455 list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange);
2456 $minCol = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] -1);
2457 $minRow = $rangeStart[1];
2458 $maxCol = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] -1);
2459 $maxRow = $rangeEnd[1];
2460
2461 $maxCol++;
2462 // Loop through rows
2463 $r = -1;
2464 for ($row = $minRow; $row <= $maxRow; ++$row) {
2465 $rRef = ($returnCellRef) ? $row : ++$r;
2466 $c = -1;
2467 // Loop through columns in the current row
2468 for ($col = $minCol; $col != $maxCol; ++$col) {
2469 $cRef = ($returnCellRef) ? $col : ++$c;
2470 // Using getCell() will create a new cell if it doesn't already exist. We don't want that to happen
2471 // so we test and retrieve directly against _cellCollection
2472 if ($this->_cellCollection->isDataSet($col.$row)) {
2473 // Cell exists
2474 $cell = $this->_cellCollection->getCacheData($col.$row);
2475 if ($cell->getValue() !== null) {
2476 if ($cell->getValue() instanceof PHPExcel_RichText) {
2477 $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText();
2478 } else {
2479 if ($calculateFormulas) {
2480 $returnValue[$rRef][$cRef] = $cell->getCalculatedValue();
2481 } else {
2482 $returnValue[$rRef][$cRef] = $cell->getValue();
2483 }
2484 }
2485
2486 if ($formatData) {
2487 $style = $this->_parent->getCellXfByIndex($cell->getXfIndex());
2488 $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString(
2489 $returnValue[$rRef][$cRef],
2490 ($style && $style->getNumberFormat()) ?
2491 $style->getNumberFormat()->getFormatCode() :
2493 );
2494 }
2495 } else {
2496 // Cell holds a NULL
2497 $returnValue[$rRef][$cRef] = $nullValue;
2498 }
2499 } else {
2500 // Cell doesn't exist
2501 $returnValue[$rRef][$cRef] = $nullValue;
2502 }
2503 }
2504 }
2505
2506 // Return
2507 return $returnValue;
2508 }
$r
Definition: example_031.php:79

References $r, $row, $style, PHPExcel_Style_NumberFormat\FORMAT_GENERAL, PHPExcel_Cell\rangeBoundaries(), PHPExcel_Cell\stringFromColumnIndex(), and PHPExcel_Style_NumberFormat\toFormattedString().

Referenced by toArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rebindParent()

PHPExcel_Worksheet::rebindParent ( PHPExcel  $parent)

Re-bind parent.

Parameters
PHPExcel$parent
Returns
PHPExcel_Worksheet

Definition at line 796 of file Worksheet.php.

796 {
797 if ($this->_parent !== null) {
798 $namedRanges = $this->_parent->getNamedRanges();
799 foreach ($namedRanges as $namedRange) {
800 $parent->addNamedRange($namedRange);
801 }
802
803 $this->_parent->removeSheetByIndex(
804 $this->_parent->getIndex($this)
805 );
806 }
807 $this->_parent = $parent;
808
809 return $this;
810 }
addNamedRange(PHPExcel_NamedRange $namedRange)
Add named range.
Definition: PHPExcel.php:778

References PHPExcel\addNamedRange().

Referenced by PHPExcel\addExternalSheet(), and PHPExcel\addSheet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshColumnDimensions()

PHPExcel_Worksheet::refreshColumnDimensions ( )

Refresh column dimensions.

Returns
PHPExcel_Worksheet

Definition at line 663 of file Worksheet.php.

664 {
665 $currentColumnDimensions = $this->getColumnDimensions();
666 $newColumnDimensions = array();
667
668 foreach ($currentColumnDimensions as $objColumnDimension) {
669 $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
670 }
671
672 $this->_columnDimensions = $newColumnDimensions;
673
674 return $this;
675 }

References getColumnDimensions().

+ Here is the call graph for this function:

◆ refreshRowDimensions()

PHPExcel_Worksheet::refreshRowDimensions ( )

Refresh row dimensions.

Returns
PHPExcel_Worksheet

Definition at line 682 of file Worksheet.php.

683 {
684 $currentRowDimensions = $this->getRowDimensions();
685 $newRowDimensions = array();
686
687 foreach ($currentRowDimensions as $objRowDimension) {
688 $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
689 }
690
691 $this->_rowDimensions = $newRowDimensions;
692
693 return $this;
694 }
getRowDimensions()
Get collection of row dimensions.
Definition: Worksheet.php:514

References getRowDimensions().

+ Here is the call graph for this function:

◆ removeAutoFilter()

PHPExcel_Worksheet::removeAutoFilter ( )

Remove autofilter.

Returns
PHPExcel_Worksheet

Definition at line 1941 of file Worksheet.php.

1942 {
1943 $this->_autoFilter->setRange(NULL);
1944 return $this;
1945 }

◆ removeColumn()

PHPExcel_Worksheet::removeColumn (   $pColumn = 'A',
  $pNumCols = 1 
)

Remove a column, updating all possible related data.

Parameters
string$pColumnRemove starting with this one
int$pNumColsNumber of columns to remove
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2088 of file Worksheet.php.

2088 {
2089 if (!is_numeric($pColumn)) {
2090 $highestColumn = $this->getHighestDataColumn();
2092 $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
2093 $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this);
2094 for($c = 0; $c < $pNumCols; ++$c) {
2095 $this->getCellCacheController()->removeColumn($highestColumn);
2097 }
2098 } else {
2099 throw new PHPExcel_Exception("Column references should not be numeric.");
2100 }
2101 return $this;
2102 }
getCellCacheController()
Return the cache controller for the cell collection.
Definition: Worksheet.php:413

References PHPExcel_Cell\columnIndexFromString(), getCellCacheController(), getHighestDataColumn(), PHPExcel_ReferenceHelper\getInstance(), and PHPExcel_Cell\stringFromColumnIndex().

Referenced by removeColumnByIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeColumnByIndex()

PHPExcel_Worksheet::removeColumnByIndex (   $pColumn = 0,
  $pNumCols = 1 
)

Remove a column, updating all possible related data.

Parameters
int$pColumnRemove starting with this one (numeric column coordinate of the cell)
int$pNumColsNumber of columns to remove
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2112 of file Worksheet.php.

2112 {
2113 if ($pColumn >= 0) {
2114 return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols);
2115 } else {
2116 throw new PHPExcel_Exception("Columns to be deleted should at least start from column 0");
2117 }
2118 }
removeColumn($pColumn='A', $pNumCols=1)
Remove a column, updating all possible related data.
Definition: Worksheet.php:2088

References removeColumn(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ removeConditionalStyles()

PHPExcel_Worksheet::removeConditionalStyles (   $pCoordinate = 'A1')

Removes conditional styles for a cell.

Parameters
string$pCoordinate
Returns
PHPExcel_Worksheet

Definition at line 1459 of file Worksheet.php.

1460 {
1461 unset($this->_conditionalStylesCollection[strtoupper($pCoordinate)]);
1462 return $this;
1463 }

◆ removeRow()

PHPExcel_Worksheet::removeRow (   $pRow = 1,
  $pNumRows = 1 
)

Delete a row, updating all possible related data.

Parameters
int$pRowRemove starting with this one
int$pNumRowsNumber of rows to remove
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2065 of file Worksheet.php.

2065 {
2066 if ($pRow >= 1) {
2067 $highestRow = $this->getHighestDataRow();
2068 $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
2069 $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this);
2070 for($r = 0; $r < $pNumRows; ++$r) {
2071 $this->getCellCacheController()->removeRow($highestRow);
2072 --$highestRow;
2073 }
2074 } else {
2075 throw new PHPExcel_Exception("Rows to be deleted should at least start from row 1.");
2076 }
2077 return $this;
2078 }

References $r, getCellCacheController(), getHighestDataRow(), and PHPExcel_ReferenceHelper\getInstance().

+ Here is the call graph for this function:

◆ resetTabColor()

PHPExcel_Worksheet::resetTabColor ( )

Reset tab color.

Returns
PHPExcel_Worksheet

Definition at line 2824 of file Worksheet.php.

2825 {
2826 $this->_tabColor = null;
2827 unset($this->_tabColor);
2828
2829 return $this;
2830 }

◆ setAutoFilter()

PHPExcel_Worksheet::setAutoFilter (   $pValue)

Set AutoFilter.

Parameters
PHPExcel_Worksheet_AutoFilter | string$pValueA simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1905 of file Worksheet.php.

1906 {
1907 $pRange = strtoupper($pValue);
1908
1909 if (is_string($pValue)) {
1910 $this->_autoFilter->setRange($pValue);
1911 } elseif(is_object($pValue) && ($pValue instanceof PHPExcel_Worksheet_AutoFilter)) {
1912 $this->_autoFilter = $pValue;
1913 }
1914 return $this;
1915 }

Referenced by setAutoFilterByColumnAndRow().

+ Here is the caller graph for this function:

◆ setAutoFilterByColumnAndRow()

PHPExcel_Worksheet::setAutoFilterByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1 
)

Set Autofilter Range by using numeric cell coordinates.

Parameters
integer$pColumn1Numeric column coordinate of the first cell
integer$pRow1Numeric row coordinate of the first cell
integer$pColumn2Numeric column coordinate of the second cell
integer$pRow2Numeric row coordinate of the second cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1927 of file Worksheet.php.

1928 {
1929 return $this->setAutoFilter(
1930 PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1
1931 . ':' .
1932 PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2
1933 );
1934 }
setAutoFilter($pValue)
Set AutoFilter.
Definition: Worksheet.php:1905

References setAutoFilter(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ setBreak()

PHPExcel_Worksheet::setBreak (   $pCell = 'A1',
  $pBreak = PHPExcel_Worksheet::BREAK_NONE 
)

Set break on a cell.

Parameters
string$pCellCell coordinate (e.g. A1)
int$pBreakBreak type (type of PHPExcel_Worksheet::BREAK_*)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1637 of file Worksheet.php.

1638 {
1639 // Uppercase coordinate
1640 $pCell = strtoupper($pCell);
1641
1642 if ($pCell != '') {
1643 if ($pBreak == PHPExcel_Worksheet::BREAK_NONE) {
1644 if (isset($this->_breaks[$pCell])) {
1645 unset($this->_breaks[$pCell]);
1646 }
1647 } else {
1648 $this->_breaks[$pCell] = $pBreak;
1649 }
1650 } else {
1651 throw new PHPExcel_Exception('No cell coordinate specified.');
1652 }
1653
1654 return $this;
1655 }

References BREAK_NONE.

Referenced by PHPExcel_ReferenceHelper\_adjustPageBreaks(), and setBreakByColumnAndRow().

+ Here is the caller graph for this function:

◆ setBreakByColumnAndRow()

PHPExcel_Worksheet::setBreakByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pBreak = PHPExcel_Worksheet::BREAK_NONE 
)

Set break on a cell by using numeric cell coordinates.

Parameters
integer$pColumnNumeric column coordinate of the cell
integer$pRowNumeric row coordinate of the cell
integer$pBreakBreak type (type of PHPExcel_Worksheet::BREAK_*)
Returns
PHPExcel_Worksheet

Definition at line 1665 of file Worksheet.php.

1666 {
1667 return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
1668 }
setBreak($pCell='A1', $pBreak=PHPExcel_Worksheet::BREAK_NONE)
Set break on a cell.
Definition: Worksheet.php:1637

References setBreak(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ setCellValue()

PHPExcel_Worksheet::setCellValue (   $pCoordinate = 'A1',
  $pValue = null,
  $returnCell = false 
)

Set a cell value.

Parameters
string$pCoordinateCoordinate of the cell
mixed$pValueValue of the cell
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified

Definition at line 1093 of file Worksheet.php.

1094 {
1095 $cell = $this->getCell(strtoupper($pCoordinate))->setValue($pValue);
1096 return ($returnCell) ? $cell : $this;
1097 }

References getCell().

+ Here is the call graph for this function:

◆ setCellValueByColumnAndRow()

PHPExcel_Worksheet::setCellValueByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pValue = null,
  $returnCell = false 
)

Set a cell value by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell (A = 0)
string$pRowNumeric row coordinate of the cell
mixed$pValueValue of the cell
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified

Definition at line 1108 of file Worksheet.php.

1109 {
1110 $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue);
1111 return ($returnCell) ? $cell : $this;
1112 }
getCellByColumnAndRow($pColumn=0, $pRow=1)
Get cell at a specific coordinate by using numeric cell coordinates.
Definition: Worksheet.php:1197

References getCellByColumnAndRow().

+ Here is the call graph for this function:

◆ setCellValueExplicit()

PHPExcel_Worksheet::setCellValueExplicit (   $pCoordinate = 'A1',
  $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING,
  $returnCell = false 
)

Set a cell value.

Parameters
string$pCoordinateCoordinate of the cell
mixed$pValueValue of the cell
string$pDataTypeExplicit data type
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified

Definition at line 1123 of file Worksheet.php.

1124 {
1125 // Set value
1126 $cell = $this->getCell(strtoupper($pCoordinate))->setValueExplicit($pValue, $pDataType);
1127 return ($returnCell) ? $cell : $this;
1128 }

References getCell().

+ Here is the call graph for this function:

◆ setCellValueExplicitByColumnAndRow()

PHPExcel_Worksheet::setCellValueExplicitByColumnAndRow (   $pColumn = 0,
  $pRow = 1,
  $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING,
  $returnCell = false 
)

Set a cell value by using numeric cell coordinates.

Parameters
string$pColumnNumeric column coordinate of the cell
string$pRowNumeric row coordinate of the cell
mixed$pValueValue of the cell
string$pDataTypeExplicit data type
bool$returnCellReturn the worksheet (false, default) or the cell (true)
Returns
PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified

Definition at line 1140 of file Worksheet.php.

1141 {
1142 $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValueExplicit($pValue, $pDataType);
1143 return ($returnCell) ? $cell : $this;
1144 }

References getCellByColumnAndRow().

+ Here is the call graph for this function:

◆ setCodeName()

PHPExcel_Worksheet::setCodeName (   $pValue = null)

Define the code name of the sheet.

Parameters
null|stringSame rule as Title minus space not allowed (but, like Excel, change silently space to underscore)
Returns
objWorksheet
Exceptions
PHPExcel_Exception

Definition at line 2887 of file Worksheet.php.

2887 {
2888 // Is this a 'rename' or not?
2889 if ($this->getCodeName() == $pValue) {
2890 return $this;
2891 }
2892 $pValue = str_replace(' ', '_', $pValue);//Excel does this automatically without flinching, we are doing the same
2893 // Syntax check
2894 // throw an exception if not valid
2896
2897 // We use the same code that setTitle to find a valid codeName else not using a space (Excel don't like) but a '_'
2898
2899 if ($this->getParent()) {
2900 // Is there already such sheet name?
2901 if ($this->getParent()->sheetCodeNameExists($pValue)) {
2902 // Use name, but append with lowest possible integer
2903
2904 if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
2905 $pValue = PHPExcel_Shared_String::Substring($pValue,0,29);
2906 }
2907 $i = 1;
2908 while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) {
2909 ++$i;
2910 if ($i == 10) {
2911 if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
2912 $pValue = PHPExcel_Shared_String::Substring($pValue,0,28);
2913 }
2914 } elseif ($i == 100) {
2915 if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
2916 $pValue = PHPExcel_Shared_String::Substring($pValue,0,27);
2917 }
2918 }
2919 }
2920
2921 $pValue = $pValue . '_' . $i;// ok, we have a valid name
2922 //codeName is'nt used in formula : no need to call for an update
2923 //return $this->setTitle($altTitle,$updateFormulaCellReferences);
2924 }
2925 }
2926
2927 $this->_codeName=$pValue;
2928 return $this;
2929 }
getCodeName()
Return the code name of the sheet.
Definition: Worksheet.php:2935
static _checkSheetCodeName($pValue)
Check sheet code name for valid Excel syntax.
Definition: Worksheet.php:435
getParent()
Get parent.
Definition: Worksheet.php:786

References _checkSheetCodeName(), PHPExcel_Shared_String\CountCharacters(), getCodeName(), getParent(), and PHPExcel_Shared_String\Substring().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setComments()

PHPExcel_Worksheet::setComments (   $pValue = array())

Set comments array for the entire sheet.

@param array of PHPExcel_Comment
Returns
PHPExcel_Worksheet

Definition at line 2236 of file Worksheet.php.

2237 {
2238 $this->_comments = $pValue;
2239
2240 return $this;
2241 }

◆ setConditionalStyles()

PHPExcel_Worksheet::setConditionalStyles (   $pCoordinate = 'A1',
  $pValue 
)

Set conditional styles.

Parameters
$pCoordinatestring E.g. 'A1'
$pValuePHPExcel_Style_Conditional[]
Returns
PHPExcel_Worksheet

Definition at line 1482 of file Worksheet.php.

1483 {
1484 $this->_conditionalStylesCollection[strtoupper($pCoordinate)] = $pValue;
1485 return $this;
1486 }

Referenced by duplicateConditionalStyle().

+ Here is the caller graph for this function:

◆ setDataValidation()

PHPExcel_Worksheet::setDataValidation (   $pCellCoordinate = 'A1',
PHPExcel_Cell_DataValidation  $pDataValidation = null 
)

Set data validation.

Parameters
string$pCellCoordinateCell coordinate to insert data validation
PHPExcel_Cell_DataValidation$pDataValidation
Returns
PHPExcel_Worksheet

Definition at line 2748 of file Worksheet.php.

2749 {
2750 if ($pDataValidation === null) {
2751 unset($this->_dataValidationCollection[$pCellCoordinate]);
2752 } else {
2753 $this->_dataValidationCollection[$pCellCoordinate] = $pDataValidation;
2754 }
2755 return $this;
2756 }

◆ setDefaultStyle()

PHPExcel_Worksheet::setDefaultStyle ( PHPExcel_Style  $pValue)

Set default style - should only be used by PHPExcel_IReader implementations!

Deprecated:
Parameters
PHPExcel_Style$pValue
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1395 of file Worksheet.php.

1396 {
1397 $this->_parent->getDefaultStyle()->applyFromArray(array(
1398 'font' => array(
1399 'name' => $pValue->getFont()->getName(),
1400 'size' => $pValue->getFont()->getSize(),
1401 ),
1402 ));
1403 return $this;
1404 }
getFont()
Get Font.
Definition: Style.php:510

References PHPExcel_Style\getFont().

+ Here is the call graph for this function:

◆ setHeaderFooter()

PHPExcel_Worksheet::setHeaderFooter ( PHPExcel_Worksheet_HeaderFooter  $pValue)

Set page header/footer.

Parameters
PHPExcel_Worksheet_HeaderFooter$pValue
Returns
PHPExcel_Worksheet

Definition at line 969 of file Worksheet.php.

970 {
971 $this->_headerFooter = $pValue;
972 return $this;
973 }

◆ setHyperlink()

PHPExcel_Worksheet::setHyperlink (   $pCellCoordinate = 'A1',
PHPExcel_Cell_Hyperlink  $pHyperlink = null 
)

Set hyperlnk.

Parameters
string$pCellCoordinateCell coordinate to insert hyperlink
PHPExcel_Cell_Hyperlink$pHyperlink
Returns
PHPExcel_Worksheet

Definition at line 2693 of file Worksheet.php.

2694 {
2695 if ($pHyperlink === null) {
2696 unset($this->_hyperlinkCollection[$pCellCoordinate]);
2697 } else {
2698 $this->_hyperlinkCollection[$pCellCoordinate] = $pHyperlink;
2699 }
2700 return $this;
2701 }

◆ setMergeCells()

PHPExcel_Worksheet::setMergeCells (   $pValue = array())

Set merge cells array for the entire sheet.

Use instead mergeCells() to merge a single cell range.

Parameters
array

Definition at line 1792 of file Worksheet.php.

1793 {
1794 $this->_mergeCells = $pValue;
1795
1796 return $this;
1797 }

◆ setPageMargins()

PHPExcel_Worksheet::setPageMargins ( PHPExcel_Worksheet_PageMargins  $pValue)

Set page margins.

Parameters
PHPExcel_Worksheet_PageMargins$pValue
Returns
PHPExcel_Worksheet

Definition at line 947 of file Worksheet.php.

948 {
949 $this->_pageMargins = $pValue;
950 return $this;
951 }

◆ setPageSetup()

PHPExcel_Worksheet::setPageSetup ( PHPExcel_Worksheet_PageSetup  $pValue)

Set page setup.

Parameters
PHPExcel_Worksheet_PageSetup$pValue
Returns
PHPExcel_Worksheet

Definition at line 925 of file Worksheet.php.

926 {
927 $this->_pageSetup = $pValue;
928 return $this;
929 }

◆ setPrintGridlines()

PHPExcel_Worksheet::setPrintGridlines (   $pValue = false)

Set print gridlines.

Parameters
boolean$pValuePrint gridlines (true/false)
Returns
PHPExcel_Worksheet

Definition at line 2155 of file Worksheet.php.

2155 {
2156 $this->_printGridlines = $pValue;
2157 return $this;
2158 }

◆ setProtection()

PHPExcel_Worksheet::setProtection ( PHPExcel_Worksheet_Protection  $pValue)

Set Protection.

Parameters
PHPExcel_Worksheet_Protection$pValue
Returns
PHPExcel_Worksheet

Definition at line 1013 of file Worksheet.php.

1014 {
1015 $this->_protection = $pValue;
1016 $this->_dirty = true;
1017
1018 return $this;
1019 }

◆ setRightToLeft()

PHPExcel_Worksheet::setRightToLeft (   $value = false)

Set right-to-left.

Parameters
boolean$valueRight-to-left true/false
Returns
PHPExcel_Worksheet

Definition at line 2390 of file Worksheet.php.

2390 {
2391 $this->_rightToLeft = $value;
2392 return $this;
2393 }

◆ setSelectedCell()

PHPExcel_Worksheet::setSelectedCell (   $pCoordinate = 'A1')

Selected cell.

Parameters
string$pCoordinateCell (i.e. A1)
Returns
PHPExcel_Worksheet

Definition at line 2323 of file Worksheet.php.

2324 {
2325 return $this->setSelectedCells($pCoordinate);
2326 }

References setSelectedCells().

+ Here is the call graph for this function:

◆ setSelectedCellByColumnAndRow()

PHPExcel_Worksheet::setSelectedCellByColumnAndRow (   $pColumn = 0,
  $pRow = 1 
)

Selected cell by using numeric cell coordinates.

Parameters
int$pColumnNumeric column coordinate of the cell
int$pRowNumeric row coordinate of the cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2370 of file Worksheet.php.

2371 {
2372 return $this->setSelectedCells(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
2373 }

References setSelectedCells(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ setSelectedCells()

PHPExcel_Worksheet::setSelectedCells (   $pCoordinate = 'A1')

Select a range of cells.

Parameters
string$pCoordinateCell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 2335 of file Worksheet.php.

2336 {
2337 // Uppercase coordinate
2338 $pCoordinate = strtoupper($pCoordinate);
2339
2340 // Convert 'A' to 'A:A'
2341 $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate);
2342
2343 // Convert '1' to '1:1'
2344 $pCoordinate = preg_replace('/^([0-9]+)$/', '${1}:${1}', $pCoordinate);
2345
2346 // Convert 'A:C' to 'A1:C1048576'
2347 $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate);
2348
2349 // Convert '1:3' to 'A1:XFD3'
2350 $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate);
2351
2352 if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) {
2353 list($first, ) = PHPExcel_Cell::splitRange($pCoordinate);
2354 $this->_activeCell = $first[0];
2355 } else {
2356 $this->_activeCell = $pCoordinate;
2357 }
2358 $this->_selectedCells = $pCoordinate;
2359 return $this;
2360 }
static splitRange($pRange='A1:A1')
Split range into coordinate strings.
Definition: Cell.php:660

References PHPExcel_Cell\splitRange().

Referenced by getStyle(), setSelectedCell(), and setSelectedCellByColumnAndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSharedStyle()

PHPExcel_Worksheet::setSharedStyle ( PHPExcel_Style  $pSharedCellStyle = null,
  $pRange = '' 
)

Set shared cell style to a range of cells.

Please note that this will overwrite existing cell styles for cells in range!

Deprecated:
Parameters
PHPExcel_Style$pSharedCellStyleCell style to share
string$pRangeRange of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1519 of file Worksheet.php.

1520 {
1521 $this->duplicateStyle($pSharedCellStyle, $pRange);
1522 return $this;
1523 }
duplicateStyle(PHPExcel_Style $pCellStyle=null, $pRange='')
Duplicate cell style to a range of cells.
Definition: Worksheet.php:1535

References duplicateStyle().

+ Here is the call graph for this function:

◆ setSheetState()

PHPExcel_Worksheet::setSheetState (   $value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE)

Set sheet state.

Parameters
string$valueSheet state (visible, hidden, veryHidden)
Returns
PHPExcel_Worksheet

Definition at line 904 of file Worksheet.php.

904 {
905 $this->_sheetState = $value;
906 return $this;
907 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setSheetView()

PHPExcel_Worksheet::setSheetView ( PHPExcel_Worksheet_SheetView  $pValue)

Set sheet view.

Parameters
PHPExcel_Worksheet_SheetView$pValue
Returns
PHPExcel_Worksheet

Definition at line 991 of file Worksheet.php.

992 {
993 $this->_sheetView = $pValue;
994 return $this;
995 }

◆ setShowGridlines()

PHPExcel_Worksheet::setShowGridlines (   $pValue = false)

Set show gridlines.

Parameters
boolean$pValueShow gridlines (true/false)
Returns
PHPExcel_Worksheet

Definition at line 2135 of file Worksheet.php.

2135 {
2136 $this->_showGridlines = $pValue;
2137 return $this;
2138 }

◆ setShowRowColHeaders()

PHPExcel_Worksheet::setShowRowColHeaders (   $pValue = false)

Set show row and column headers.

Parameters
boolean$pValueShow row and column headers (true/false)
Returns
PHPExcel_Worksheet

Definition at line 2175 of file Worksheet.php.

2175 {
2176 $this->_showRowColHeaders = $pValue;
2177 return $this;
2178 }

◆ setShowSummaryBelow()

PHPExcel_Worksheet::setShowSummaryBelow (   $pValue = true)

Set show summary below.

Parameters
boolean$pValueShow summary below (true/false)
Returns
PHPExcel_Worksheet

Definition at line 2195 of file Worksheet.php.

2195 {
2196 $this->_showSummaryBelow = $pValue;
2197 return $this;
2198 }

◆ setShowSummaryRight()

PHPExcel_Worksheet::setShowSummaryRight (   $pValue = true)

Set show summary right.

Parameters
boolean$pValueShow summary right (true/false)
Returns
PHPExcel_Worksheet

Definition at line 2215 of file Worksheet.php.

2215 {
2216 $this->_showSummaryRight = $pValue;
2217 return $this;
2218 }

◆ setTitle()

PHPExcel_Worksheet::setTitle (   $pValue = 'Worksheet',
  $updateFormulaCellReferences = true 
)

Set title.

Parameters
string$pValueString containing the dimension of this worksheet
string$updateFormulaCellReferencesboolean Flag indicating whether cell references in formulae should be updated to reflect the new sheet name. This should be left as the default true, unless you are certain that no formula cells on any worksheet contain references to this worksheet
Returns
PHPExcel_Worksheet

Definition at line 833 of file Worksheet.php.

834 {
835 // Is this a 'rename' or not?
836 if ($this->getTitle() == $pValue) {
837 return $this;
838 }
839
840 // Syntax check
841 self::_checkSheetTitle($pValue);
842
843 // Old title
844 $oldTitle = $this->getTitle();
845
846 if ($this->_parent) {
847 // Is there already such sheet name?
848 if ($this->_parent->sheetNameExists($pValue)) {
849 // Use name, but append with lowest possible integer
850
851 if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
852 $pValue = PHPExcel_Shared_String::Substring($pValue,0,29);
853 }
854 $i = 1;
855 while ($this->_parent->sheetNameExists($pValue . ' ' . $i)) {
856 ++$i;
857 if ($i == 10) {
858 if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
859 $pValue = PHPExcel_Shared_String::Substring($pValue,0,28);
860 }
861 } elseif ($i == 100) {
862 if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
863 $pValue = PHPExcel_Shared_String::Substring($pValue,0,27);
864 }
865 }
866 }
867
868 $altTitle = $pValue . ' ' . $i;
869 return $this->setTitle($altTitle,$updateFormulaCellReferences);
870 }
871 }
872
873 // Set title
874 $this->_title = $pValue;
875 $this->_dirty = true;
876
877 if ($this->_parent) {
878 // New title
879 $newTitle = $this->getTitle();
881 ->renameCalculationCacheForWorksheet($oldTitle, $newTitle);
882 if ($updateFormulaCellReferences)
883 PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_parent, $oldTitle, $newTitle);
884 }
885
886 return $this;
887 }
static _checkSheetTitle($pValue)
Check sheet title for valid Excel syntax.
Definition: Worksheet.php:463

References _checkSheetTitle(), PHPExcel_Shared_String\CountCharacters(), PHPExcel_ReferenceHelper\getInstance(), PHPExcel_Calculation\getInstance(), getTitle(), setTitle(), and PHPExcel_Shared_String\Substring().

Referenced by __construct(), and setTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shrinkRangeToFit()

PHPExcel_Worksheet::shrinkRangeToFit (   $range)

Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet.

Parameters
string$range
Returns
string Adjusted range value

Definition at line 2785 of file Worksheet.php.

2785 {
2786 $maxCol = $this->getHighestColumn();
2787 $maxRow = $this->getHighestRow();
2788 $maxCol = PHPExcel_Cell::columnIndexFromString($maxCol);
2789
2790 $rangeBlocks = explode(' ',$range);
2791 foreach ($rangeBlocks as &$rangeSet) {
2792 $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet);
2793
2794 if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) { $rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); }
2795 if ($rangeBoundaries[0][1] > $maxRow) { $rangeBoundaries[0][1] = $maxRow; }
2796 if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) { $rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); }
2797 if ($rangeBoundaries[1][1] > $maxRow) { $rangeBoundaries[1][1] = $maxRow; }
2798 $rangeSet = $rangeBoundaries[0][0].$rangeBoundaries[0][1].':'.$rangeBoundaries[1][0].$rangeBoundaries[1][1];
2799 }
2800 unset($rangeSet);
2801 $stRange = implode(' ',$rangeBlocks);
2802
2803 return $stRange;
2804 }
static getRangeBoundaries($pRange='A1:A1')
Calculate range boundaries.
Definition: Cell.php:756

References PHPExcel_Cell\columnIndexFromString(), getHighestColumn(), getHighestRow(), PHPExcel_Cell\getRangeBoundaries(), and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ sortCellCollection()

PHPExcel_Worksheet::sortCellCollection ( )

Sort collection of cells.

Returns
PHPExcel_Worksheet

Definition at line 501 of file Worksheet.php.

502 {
503 if ($this->_cellCollection !== NULL) {
504 return $this->_cellCollection->getSortedCellList();
505 }
506 return array();
507 }

Referenced by getCellCollection().

+ Here is the caller graph for this function:

◆ toArray()

PHPExcel_Worksheet::toArray (   $nullValue = null,
  $calculateFormulas = true,
  $formatData = true,
  $returnCellRef = false 
)

Create array from worksheet.

Parameters
mixed$nullValueValue returned in the array entry if a cell doesn't exist
boolean$calculateFormulasShould formulas be calculated?
boolean$formatDataShould formatting be applied to cell values?
boolean$returnCellRefFalse - Return a simple array of rows and columns indexed by number counting from zero True - Return rows and columns indexed by their actual row and column IDs
Returns
array

Definition at line 2547 of file Worksheet.php.

2547 {
2548 // Garbage collect...
2549 $this->garbageCollect();
2550
2551 // Identify the range that we need to extract from the worksheet
2552 $maxCol = $this->getHighestColumn();
2553 $maxRow = $this->getHighestRow();
2554 // Return
2555 return $this->rangeToArray( 'A1:'.$maxCol.$maxRow,
2556 $nullValue, $calculateFormulas, $formatData, $returnCellRef);
2557 }
garbageCollect()
Run PHPExcel garabage collector.
Definition: Worksheet.php:2588
rangeToArray($pRange='A1', $nullValue=null, $calculateFormulas=true, $formatData=true, $returnCellRef=false)
Create array from a range of cells.
Definition: Worksheet.php:2451

References garbageCollect(), getHighestColumn(), getHighestRow(), and rangeToArray().

+ Here is the call graph for this function:

◆ unfreezePane()

PHPExcel_Worksheet::unfreezePane ( )

Unfreeze Pane.

Returns
PHPExcel_Worksheet

Definition at line 2000 of file Worksheet.php.

2001 {
2002 return $this->freezePane('');
2003 }

References freezePane().

+ Here is the call graph for this function:

◆ unmergeCells()

PHPExcel_Worksheet::unmergeCells (   $pRange = 'A1:A1')

Remove merge on a cell range.

Parameters
string$pRangeCell range (e.g. A1:E1)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1742 of file Worksheet.php.

1742 :A1')
1743 {
1744 // Uppercase coordinate
1745 $pRange = strtoupper($pRange);
1746
1747 if (strpos($pRange,':') !== false) {
1748 if (isset($this->_mergeCells[$pRange])) {
1749 unset($this->_mergeCells[$pRange]);
1750 } else {
1751 throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as merged.');
1752 }
1753 } else {
1754 throw new PHPExcel_Exception('Merge can only be removed from a range of cells.');
1755 }
1756
1757 return $this;
1758 }

Referenced by unmergeCellsByColumnAndRow().

+ Here is the caller graph for this function:

◆ unmergeCellsByColumnAndRow()

PHPExcel_Worksheet::unmergeCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1 
)

Remove merge on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1770 of file Worksheet.php.

1771 {
1772 $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
1773 return $this->unmergeCells($cellRange);
1774 }
unmergeCells($pRange='A1:A1')
Remove merge on a cell range.
Definition: Worksheet.php:1742

References PHPExcel_Cell\stringFromColumnIndex(), and unmergeCells().

+ Here is the call graph for this function:

◆ unprotectCells()

PHPExcel_Worksheet::unprotectCells (   $pRange = 'A1')

Remove protection on a cell range.

Parameters
string$pRangeCell (e.g. A1) or cell range (e.g. A1:E1)
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1846 of file Worksheet.php.

1847 {
1848 // Uppercase coordinate
1849 $pRange = strtoupper($pRange);
1850
1851 if (isset($this->_protectedCells[$pRange])) {
1852 unset($this->_protectedCells[$pRange]);
1853 } else {
1854 throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as protected.');
1855 }
1856 return $this;
1857 }

Referenced by unprotectCellsByColumnAndRow().

+ Here is the caller graph for this function:

◆ unprotectCellsByColumnAndRow()

PHPExcel_Worksheet::unprotectCellsByColumnAndRow (   $pColumn1 = 0,
  $pRow1 = 1,
  $pColumn2 = 0,
  $pRow2 = 1,
  $pPassword = '',
  $pAlreadyHashed = false 
)

Remove protection on a cell range by using numeric cell coordinates.

Parameters
int$pColumn1Numeric column coordinate of the first cell
int$pRow1Numeric row coordinate of the first cell
int$pColumn2Numeric column coordinate of the last cell
int$pRow2Numeric row coordinate of the last cell
string$pPasswordPassword to unlock the protection
boolean$pAlreadyHashedIf the password has already been hashed, set this to true
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet

Definition at line 1871 of file Worksheet.php.

1872 {
1873 $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
1874 return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed);
1875 }
unprotectCells($pRange='A1')
Remove protection on a cell range.
Definition: Worksheet.php:1846

References PHPExcel_Cell\stringFromColumnIndex(), and unprotectCells().

+ Here is the call graph for this function:

Field Documentation

◆ $_activeCell

PHPExcel_Worksheet::$_activeCell = 'A1'
private

Definition at line 263 of file Worksheet.php.

Referenced by getActiveCell().

◆ $_autoFilter

PHPExcel_Worksheet::$_autoFilter = NULL
private

Definition at line 207 of file Worksheet.php.

Referenced by __clone(), and getAutoFilter().

◆ $_breaks

PHPExcel_Worksheet::$_breaks = array()
private

Definition at line 186 of file Worksheet.php.

Referenced by getBreaks().

◆ $_cachedHighestColumn

PHPExcel_Worksheet::$_cachedHighestColumn = 'A'
private

Definition at line 277 of file Worksheet.php.

Referenced by getHighestColumn().

◆ $_cachedHighestRow

PHPExcel_Worksheet::$_cachedHighestRow = 1
private

Definition at line 284 of file Worksheet.php.

Referenced by getHighestRow().

◆ $_cellCollection

PHPExcel_Worksheet::$_cellCollection = null
private

Definition at line 67 of file Worksheet.php.

Referenced by __clone(), and getCellCacheController().

◆ $_cellCollectionIsSorted

PHPExcel_Worksheet::$_cellCollectionIsSorted = false
private

Definition at line 179 of file Worksheet.php.

◆ $_chartCollection

PHPExcel_Worksheet::$_chartCollection = array()
private

Definition at line 109 of file Worksheet.php.

Referenced by getChartCollection().

◆ $_codeName

PHPExcel_Worksheet::$_codeName = null
private

Definition at line 333 of file Worksheet.php.

Referenced by getCodeName().

◆ $_columnDimensions

PHPExcel_Worksheet::$_columnDimensions = array()
private

Definition at line 88 of file Worksheet.php.

Referenced by getColumnDimensions().

◆ $_comments

PHPExcel_Worksheet::$_comments = array()
private

Definition at line 256 of file Worksheet.php.

Referenced by getComments().

◆ $_conditionalStylesCollection

PHPExcel_Worksheet::$_conditionalStylesCollection = array()
private

Definition at line 172 of file Worksheet.php.

Referenced by getConditionalStylesCollection().

◆ $_dataValidationCollection

PHPExcel_Worksheet::$_dataValidationCollection = array()
private

Definition at line 305 of file Worksheet.php.

Referenced by getDataValidationCollection().

◆ $_defaultColumnDimension

PHPExcel_Worksheet::$_defaultColumnDimension = null
private

Definition at line 95 of file Worksheet.php.

Referenced by getDefaultColumnDimension().

◆ $_defaultRowDimension

PHPExcel_Worksheet::$_defaultRowDimension = null
private

Definition at line 81 of file Worksheet.php.

Referenced by getDefaultRowDimension().

◆ $_dirty

PHPExcel_Worksheet::$_dirty = true
private

Definition at line 319 of file Worksheet.php.

◆ $_drawingCollection

PHPExcel_Worksheet::$_drawingCollection = null
private

Definition at line 102 of file Worksheet.php.

Referenced by __clone(), and getDrawingCollection().

◆ $_freezePane

PHPExcel_Worksheet::$_freezePane = ''
private

Definition at line 214 of file Worksheet.php.

Referenced by getFreezePane().

◆ $_hash

PHPExcel_Worksheet::$_hash = null
private

Definition at line 326 of file Worksheet.php.

Referenced by getHashCode().

◆ $_headerFooter

PHPExcel_Worksheet::$_headerFooter
private

Definition at line 144 of file Worksheet.php.

Referenced by getHeaderFooter().

◆ $_hyperlinkCollection

PHPExcel_Worksheet::$_hyperlinkCollection = array()
private

Definition at line 298 of file Worksheet.php.

Referenced by getHyperlinkCollection().

◆ $_invalidCharacters

PHPExcel_Worksheet::$_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']')
staticprivate

Definition at line 53 of file Worksheet.php.

Referenced by getInvalidCharacters().

◆ $_mergeCells

PHPExcel_Worksheet::$_mergeCells = array()
private

Definition at line 193 of file Worksheet.php.

Referenced by getMergeCells().

◆ $_pageMargins

PHPExcel_Worksheet::$_pageMargins
private

Definition at line 137 of file Worksheet.php.

Referenced by getPageMargins().

◆ $_pageSetup

PHPExcel_Worksheet::$_pageSetup
private

Definition at line 130 of file Worksheet.php.

Referenced by getPageSetup().

◆ $_parent

PHPExcel_Worksheet::$_parent
private

Definition at line 60 of file Worksheet.php.

Referenced by duplicateStyle(), and getParent().

◆ $_printGridlines

PHPExcel_Worksheet::$_printGridlines = false
private

Definition at line 228 of file Worksheet.php.

Referenced by getPrintGridlines().

◆ $_protectedCells

PHPExcel_Worksheet::$_protectedCells = array()
private

Definition at line 200 of file Worksheet.php.

Referenced by getProtectedCells().

◆ $_protection

PHPExcel_Worksheet::$_protection
private

Definition at line 158 of file Worksheet.php.

Referenced by getProtection().

◆ $_rightToLeft

PHPExcel_Worksheet::$_rightToLeft = false
private

Definition at line 291 of file Worksheet.php.

Referenced by getRightToLeft().

◆ $_rowDimensions

PHPExcel_Worksheet::$_rowDimensions = array()
private

Definition at line 74 of file Worksheet.php.

Referenced by getRowDimensions().

◆ $_selectedCells

PHPExcel_Worksheet::$_selectedCells = 'A1'
private

Definition at line 270 of file Worksheet.php.

Referenced by getSelectedCells().

◆ $_sheetState

PHPExcel_Worksheet::$_sheetState
private

Definition at line 123 of file Worksheet.php.

Referenced by getSheetState().

◆ $_sheetView

PHPExcel_Worksheet::$_sheetView
private

Definition at line 151 of file Worksheet.php.

Referenced by getSheetView().

◆ $_showGridlines

PHPExcel_Worksheet::$_showGridlines = true
private

Definition at line 221 of file Worksheet.php.

Referenced by getShowGridlines().

◆ $_showRowColHeaders

PHPExcel_Worksheet::$_showRowColHeaders = true
private

Definition at line 235 of file Worksheet.php.

Referenced by getShowRowColHeaders().

◆ $_showSummaryBelow

PHPExcel_Worksheet::$_showSummaryBelow = true
private

Definition at line 242 of file Worksheet.php.

Referenced by getShowSummaryBelow().

◆ $_showSummaryRight

PHPExcel_Worksheet::$_showSummaryRight = true
private

Definition at line 249 of file Worksheet.php.

Referenced by getShowSummaryRight().

◆ $_styles

PHPExcel_Worksheet::$_styles = array()
private

Definition at line 165 of file Worksheet.php.

Referenced by getStyles().

◆ $_tabColor

PHPExcel_Worksheet::$_tabColor
private

Definition at line 312 of file Worksheet.php.

Referenced by getTabColor().

◆ $_title

PHPExcel_Worksheet::$_title
private

Definition at line 116 of file Worksheet.php.

Referenced by getTitle().

◆ BREAK_COLUMN

◆ BREAK_NONE

const PHPExcel_Worksheet::BREAK_NONE = 0

◆ BREAK_ROW

◆ SHEETSTATE_HIDDEN

const PHPExcel_Worksheet::SHEETSTATE_HIDDEN = 'hidden'

Definition at line 45 of file Worksheet.php.

Referenced by PHPExcel_Reader_Excel5\_readSheet().

◆ SHEETSTATE_VERYHIDDEN

const PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN = 'veryHidden'

Definition at line 46 of file Worksheet.php.

Referenced by PHPExcel_Reader_Excel5\_readSheet().

◆ SHEETSTATE_VISIBLE

const PHPExcel_Worksheet::SHEETSTATE_VISIBLE = 'visible'

Definition at line 44 of file Worksheet.php.

Referenced by __construct(), and PHPExcel_Reader_Excel5\_readSheet().


The documentation for this class was generated from the following file: