php - Read merged cells PhPExcel -
i'm trying read merged cell in phpexcel, problem cell merged on a:b:c:d:e:f ( can't argue want )
$i= 0; foreach ($worksheet->getrowiterator() $row) { if ($i > 10) break ; $i ++; $celliterator = $row->getcelliterator(); foreach ($celliterator $cell) { if($cell->getcolumn()== 'a:b:c:d:e:f'){ $specification=$cell->getcalculatedvalue(); var_dump($specification);die(); // other code
always dumps null.
i've tried $cell->getcolumn()== 'a'
since cell starts @ a, dumps null well.
i appreciate help.
i don't understand you're trying here, because getcolumn()
ever return single column address a
or b
, never 'a:b:c:d:e:f'
it may sensible iterate existing cells using
$celliterator->setiterateonlyexistingcells(true);
but there's couple of functions may merged cells:
$cell->isinmergerange()
will return boolean true/false, indicating if cell part of merge range
and
$cell->ismergerangevaluecell()
can used test whether cell within merge range top-left (primary) cell of range, , return boolean true/false indicating whether holds actual data value/type etc range... note return false if cell isn't part of merge range
Comments
Post a Comment