You are here

public function PHPExcel_CachedObjectStorage_CacheBase::getHighestRowAndColumn in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php \PHPExcel_CachedObjectStorage_CacheBase::getHighestRowAndColumn()

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

Return value

array Highest column name and highest row number

2 calls to PHPExcel_CachedObjectStorage_CacheBase::getHighestRowAndColumn()
PHPExcel_CachedObjectStorage_CacheBase::getHighestColumn in vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php
* Get highest worksheet column *
PHPExcel_CachedObjectStorage_CacheBase::getHighestRow in vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php
* Get highest worksheet row *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php, line 200

Class

PHPExcel_CachedObjectStorage_CacheBase
PHPExcel_CachedObjectStorage_CacheBase

Code

public function getHighestRowAndColumn() {

  // Lookup highest column and highest row
  $col = array(
    'A' => '1A',
  );
  $row = array(
    1,
  );
  foreach ($this
    ->getCellList() as $coord) {
    sscanf($coord, '%[A-Z]%d', $c, $r);
    $row[$r] = $r;
    $col[$c] = strlen($c) . $c;
  }
  if (!empty($row)) {

    // Determine highest column and row
    $highestRow = max($row);
    $highestColumn = substr(max($col), 1);
  }
  return array(
    'row' => $highestRow,
    'column' => $highestColumn,
  );
}