getPropert"> getPropert" />
欢迎来到天天文库
浏览记录
ID:13465070
大小:63.50 KB
页数:8页
时间:2018-07-22
《phpexcel中文帮助手册》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、phpExcel中文帮助手册1、设置excel的属性:创建人$objPHPExcel->getProperties()->setCreator("MaartenBalliauw");最后修改人$objPHPExcel->getProperties()->setLastModifiedBy("MaartenBalliauw");标题$objPHPExcel->getProperties()->setTitle("Office2007XLSXTestDocument");题目$objPHPExcel->getProperties()->setSubject
2、("Office2007XLSXTestDocument");描述$objPHPExcel->getProperties()->setDescription("TestdocumentforOffice2007XLSX,generatedusingPHPclasses.");关键字$objPHPExcel->getProperties()->setKeywords("office2007openxmlphp");种类$objPHPExcel->getProperties()->setCategory("Testresultfile");设置当前的she
3、et$objPHPExcel->setActiveSheetIndex(0);设置sheet的name$objPHPExcel->getActiveSheet()->setTitle('Simple');设置单元格的值复制代码代码示例:$objPHPExcel->getActiveSheet()->setCellValue('A1','String');$objPHPExcel->getActiveSheet()->setCellValue('A2',12);$objPHPExcel->getActiveSheet()->setCellValue('A
4、3',true);$objPHPExcel->getActiveSheet()->setCellValue('C5','=SUM(C2:C4)');$objPHPExcel->getActiveSheet()->setCellValue('B8','=MIN(B2:C5)');合并单元格复制代码代码示例:$objPHPExcel->getActiveSheet()->mergeCells('A18:E22');分离单元格复制代码代码示例:$objPHPExcel->getActiveSheet()->unmergeCells('A28:B28');保护
5、cell复制代码代码示例:$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);//Needstobesettotrueinordertoenableanyworksheetprotection!$objPHPExcel->getActiveSheet()->protectCells('A3:E13','PHPExcel');设置格式复制代码代码示例://Setcellnumberformatsechodate('H:i:s')."Setcellnumberformats";
6、$objPHPExcel->getActiveSheet()->getStyle('E4')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE);$objPHPExcel->getActiveSheet()->duplicateStyle($objPHPExcel->getActiveSheet()->getStyle('E4'),'E5:E13');设置宽width复制代码代码示例://Setcolumnwidths$ob
7、jPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(12);设置font复制代码代码示例:$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setName('Candara');$objPHPExcel->getActiveSheet()->getStyle('B1
8、')->getFont()->setSize(20);$objPHPExcel->getAct
此文档下载收益归作者所有