当前位置: 网学 > 编程文档 > PHP > 正文

php excel类 phpExcel使用方法介绍

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/21
()->getStyle(''E4′)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE);
  $objPHPExcel->getActiveSheet()->duplicateStyle( $objPHPExcel->getActiveSheet()->getStyle(''E4′), ‘E5:E13′ );
  设置宽width
  // Set column widths
  $objPHPExcel->getActiveSheet()->getColumnDimension(''B'')->setAutoSize(true);
  $objPHPExcel->getActiveSheet()->getColumnDimension(''D'')->setWidth(12);
  设置font
  $objPHPExcel->getActiveSheet()->getStyle(''B1′)->getFont()->setName(''Candara'');
  $objPHPExcel->getActiveSheet()->getStyle(''B1′)->getFont()->setSize(20);
  $objPHPExcel->getActiveSheet()->getStyle(''B1′)->getFont()->setBold(true);
  $objPHPExcel->getActiveSheet()->getStyle(''B1′)->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
  $objPHPExcel->getActiveSheet()->getStyle(''B1′)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);
  $objPHPExcel->getActiveSheet()->getStyle(''E1′)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);
  $objPHPExcel->getActiveSheet()->getStyle(''D13′)->getFont()->setBold(true);
  $objPHPExcel->getActiveSheet()->getStyle(''E13′)->getFont()->setBold(true);
  设置align
  $objPHPExcel->getActiveSheet()->getStyle(''D11′)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
  $objPHPExcel->getActiveSheet()->getStyle(''D12′)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
  $objPHPExcel->getActiveSheet()->getStyle(''D13′)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
  $objPHPExcel->getActiveSheet()->getStyle(''A18′)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY);
  //垂直居中
  $objPHPExcel->getActiveSheet()->getStyle(''A18′)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
  设置column的border
  $objPHPExcel->getActiveSheet()->getStyle(''A4′)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
  $objPHPExcel->getActiveSheet()->getStyle(''B4′)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
  $objPHPExcel->getActiveSheet()->getStyle(''C4′)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
  $objPHPExcel->getActiveSheet()->getStyle(''D4′)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
  $objPHPExcel->getActiveSheet()->getStyle(''E4′)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
  设置border的color
  $objPHPExcel->getActiveSheet()->getStyle(''D13′)->getBorders()->getLeft()->getColor()->setARGB(''FF993300′);
  $objP

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号