Links disappears if I remove line above them

Topics: Developer Forum
Oct 1, 2010 at 4:05 PM
Edited Oct 1, 2010 at 4:10 PM

Hi , I've got next issue,

I use template line  with placeholders

%%name%%  %%income%% etc

I add pack of new lines below it

$objWorksheet->insertNewRowBefore($cells_info["row"]+1, count($this -> data['affiliates_overview']));

then I put data to each line

foreach ($this -> data['affiliates_overview'] as $row) { //get row 
$row_index++;
 foreach ($row as $name => $value) { //get cell
if (!empty($cells_info['cells'][$name])){
$cell_index = $cells_info['cells'][$name]['column'].$row_index;
  if ($name == 'name' && $value != 'TOTAL') { //add name with link
    $objWorksheet->getCell($cell_index)->setValue(preg_replace("/%%.+%%/", $value, $cells_info['cells'][$name]['placeholder']));
     $objWorksheet->getCell($cell_index)->getHyperlink()->setUrl("sheet://'".substr($row->affiliate_." ". $row->name, 0, XML_MAX_TITLE_LENGTH)."'!A1");
    $objWorksheet->getStyle($cell_index)->getFont()->setUnderline(true);
    $objWorksheet->getStyle($cell_index)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_BLUE);
  } else {   // add any value
    $objWorksheet->setCellValue($cell_index, preg_replace("/%%.+%%/", $value, $cells_info['cells'][$name]['placeholder']));
  }
}
}
}

do dump and can see links in each line ,  then I remove placeholder line

$objWorksheet->removeRow($cells_info['row'],1);

after this I do dump and there is link only in first line, but if I hide placeholder line

 $objWorksheet->getRowDimension($cells_info['row'])->setVisible(false);

links don't disappear

Is it bug or I do something wrong ? Also getFont()->setUnderline(true) doesn't work too, I can't understand why.