Ejemplo n.º 1
0
function myExcel_WriteValuesToActiveRow(&$objPHPExcel, $arrValues)
{
    for ($x = 0; $x < count($arrValues); $x++) {
        $columnLetter = chr(ord('A') + $x);
        $objPHPExcel->getActiveSheet()->SetCellValue($columnLetter . myExcel_getActiveRow(), $arrValues[$x]);
    }
}
 function myExcel_WriteValuesToActiveRow(&$objPHPExcel, $arrValues, $rowBold = false)
 {
     $x = 0;
     $activeSheet = $objPHPExcel->getActiveSheet();
     foreach ($arrValues as $value) {
         // Get cell location i.e. A1 or C3
         $columnLetter = PHPExcel_Cell::stringFromColumnIndex($x);
         $cellLocation = $columnLetter . myExcel_getActiveRow();
         // Debug
         if (strpos(request_uri(), '-DEBUG-NOEXCELWRITE-REPORTWRITE-') !== false) {
             print "write to {$cellLocation} with {$value} <br/>\n";
         } else {
             // Set this cell value
             $activeSheet->SetCellValue($cellLocation, strip_tags($value));
             // Set this cell style
             if ($rowBold === true) {
                 $activeSheet->getStyle($cellLocation)->applyFromArray(array('font' => array('bold' => true)));
             }
         }
         $x++;
     }
 }