编程语言
首页 > 编程语言> > PHPExcel生成Excel文件---提示Class 'PHPExcel_Style_Alignment' not found

PHPExcel生成Excel文件---提示Class 'PHPExcel_Style_Alignment' not found

作者:互联网

解决办法是在PHPExcel_Style_Alignment 和PHPExcel_Style_Border 前面加上"\"符号,就完美解决了

$objPHPExcel->getActiveSheet()->getStyle('A')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);

在thinkphp的使用中最后的 PHPExcel_Style_Alignment::HORIZONTAL_CENTER 要写成
\PHPExcel_Style_Alignment::HORIZONTAL_CENTER才能调用到。

标签:Style,CENTER,Excel,PHPExcel,HORIZONTAL,Alignment
来源: https://www.cnblogs.com/dayin1/p/11696338.html