Uncollapse doesn't work correctly

Topics: User Forum
Feb 24, 2013 at 11:06 AM
Hello,

I created the following structure
+ 111
  111
  111
         + 222
           222
           222
  111
  111
Then I made first and second levels collapsed. The problem is: when I click the first "+" both levels open. But I need the following result (after clicking the first-level "+"):
+ 111
  111
  111
         - 222
  111
  111

The code is:
$aSheet = $objPHPExcel->getActiveSheet();

for ($i = 31; $i <= 50; $i++) {
    $aSheet->setCellValue('A' . $i, "FName $i");
    $aSheet->setCellValue('B' . $i, "LName $i");
    $aSheet->setCellValue('C' . $i, "PhoneNo $i");
    
    if($i > 35 && $i < 40)
    {
        $aSheet->getRowDimension($i)->setOutlineLevel(2);
        $aSheet->getRowDimension($i)->setVisible(false);
    }
    else
    {
        $aSheet->getRowDimension($i)->setOutlineLevel(1);
        $aSheet->getRowDimension($i)->setVisible(false);
    }
}

$aSheet->getRowDimension(51)->setCollapsed(true);