public function PHPExcel_Worksheet::namedRangeToArray in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php \PHPExcel_Worksheet::namedRangeToArray()
Create array from a range of cells
Parameters
string $pNamedRange Name of the Named Range:
mixed $nullValue Value returned in the array entry if a cell doesn't exist:
boolean $calculateFormulas Should formulas be calculated?:
boolean $formatData Should formatting be applied to cell values?:
boolean $returnCellRef False - 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
Return value
array
Throws
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Worksheet.php, line 2523
Class
- PHPExcel_Worksheet
- PHPExcel_Worksheet
Code
public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) {
$namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this);
if ($namedRange !== NULL) {
$pWorkSheet = $namedRange
->getWorksheet();
$pCellRange = $namedRange
->getRange();
return $pWorkSheet
->rangeToArray($pCellRange, $nullValue, $calculateFormulas, $formatData, $returnCellRef);
}
throw new PHPExcel_Exception('Named Range ' . $pNamedRange . ' does not exist.');
}