Codeigniter PHPExcel error class STYLE

Topics: Developer Forum
Aug 22, 2011 at 7:19 PM

Greetings, I am using PHPExcel with CodeIgniter, I'm trying to align text in a cellnumber to the left, but I get the following error: Fatal error: Class 'PHPExcel_Style_Alignment' not found in C: \ AppServ \ www \ systemp. I can not find the aforementioned class, someone could help me I leave a piece ofcode. thank you very much.

 

$styleArray = array(
                            'alignment' => array(
                                'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
                            ));

$objPHPExcel->getActiveSheet()->getStyle($cl3 . $xlsRow)->applyFromArray($styleArray);

Aug 23, 2011 at 5:21 AM
$objPHPExcel->getActiveSheet()->getStyle($cl3 . $xlsRow)->getAlignment()->applyFromArray($styleArray);
Aug 23, 2011 at 6:02 AM

no work, same error

$styleArray = array(
                            'alignment' => array(
                                'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
                            ));
$objPHPExcel->getActiveSheet()->getStyle($cl3 . $xlsRow)->getAlignment()->applyFromArray($styleArray);

 

Fatal error: Class 'PHPExcel_Style_Alignment' not found in C:\AppServ\www

Aug 24, 2011 at 10:52 AM

$alignleft  = array(
                    'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
                    'rotation'   => 0
                );

$objPHPExcel->getActiveSheet()->getStyle('D6:F6')->getAlignment()->applyFromArray($alignleft );

Aug 30, 2011 at 8:22 PM

Solved!

Codeigniter The problem with the name of the class.


this:

'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,

for:
'horizontal' => Style_Alignment::HORIZONTAL_LEFT,

thanks all for helpe me