PROBLEME WITH getStyleByColumnAndRow()

Topics: Developer Forum
Mar 6, 2013 at 3:43 PM
Edited Mar 6, 2013 at 4:20 PM
Hi,

Windows 7 64 bits
PHPExcel 1.7.7

when i writing this code :
    $act=$rec[$i]['ACT'];
$act_row=4;
$val_etat=0;
if(is_array($act)==true)
{
    for($j=0;$j<sizeof($act);$j++)
    {
        $sheet->setCellValueByColumnAndRow(20,$act_row, $act[$j]['type_action']);
        $sheet->setCellValueByColumnAndRow(21,$act_row, $act[$j]['num_doc']);
        $sheet->setCellValueByColumnAndRow(22,$act_row, $act[$j]['cout']);

        if($act[$j]['type_action']!="" and $act[$j]['num_doc']=="")
                             {$act_etat="EN COURS";$act_bgcolor="FFFF8C00";$val_etat+=1;}
        if($act[$j]['type_action']!="" and $act[$j]['num_doc']!="")
                             {$act_etat="CLOS";$act_bgcolor="FF228B22";$val_etat+=2;}

                     $sheet->setCellValueByColumnAndRow(23,$act_row, $act_etat);    
                    $sheet->getStyleByColumnAndRow(23,$act_row)->getFill()->getStartColor()->setARGB($act_bgcolor);
            }
    }
The cell in (23,$act_row) rest white.
If i writting
           $sheet->getStyleByColumnAndRow(23,4)->getFill()->getStartColor()->setARGB($act_bgcolor);
my cell take a good color ....
I don't understant why ?

Can you help me ?

Thank