PHP Excel类Spreadsheet_Excel_Writer包含在Pear中。要使用Pear请先安装Pear
Pear的安装十分简单,一般php都包含有pear,只需加载一下就OK
Unix/Linux/BSD下执行lynx -source http://pear.php.net/go-pear | php命令
Mac OS X下执行curl http://pear.php.net/go-pear | sudo php并运行php go-pear.php
Windows下运行php目录下和空间服务器的话只需从http://pear.php.net/go-pear拷下其内容,新建保存到pear/go-pear.php并访问这个php安装就可以了。当然还要注意Pear的访问安全。
默认Pear并不安装Spreadsheet_Excel_Writer要另外安装windows下
运行pear install OLE-1.0.0RC1和pear install Spreadsheet_Excel_Writer-0.9.1就OK了
Spreadsheet_Excel_Writer其主要包括Spreadsheet_Excel_Writer,Workbook,Worksheet和Format四大类
Spreadsheet_Excel_Writer总的类,也是其对外接口包含Workbook,Worksheet和Format三个内部成员
Spreadsheet_Excel_Writer
Spreadsheet_Excel_Writer::Spreadsheet_Excel_Writer -- T构造函数. 产生并返回一个Workbook
Spreadsheet_Excel_Writer::send -- 传一个Excel文件HTTP的header,一般用的excel导出
Spreadsheet_Excel_Writer::rowcolToCell -- 设置公用的Excel格式
Workbook 工作台
Workbook::close -- 关闭工作台
Workbook::&addWorksheet -- 新增一个工作表,返回工作表
Workbook::&addFormat --新增一个工作表的格式化,返回格式化
Workbook::setCountry -- 设置国家区域,参数为国家数字代码
Workbook::&setTempDir -- 设置OLE临时文件的目录
Workbook::setVersion -- 设置BIFF版本
Workbook::setCustomColor -- 设置颜色变量
Workbook::worksheets -- 返回 工作台的工作表
Worksheet 工作表
Worksheet::getName -- 获取工作表名
Worksheet::setInputEncoding -- 设置字符集格式
Worksheet::select -- 选择一个工作表作为当前操作的工作表
Worksheet::activate -- 设置活动的的工作表
Worksheet::setFirstSheet -- 设置第一个显示的工作表,特别是当活动的工作表没显示
Worksheet::protect -- 设置工作表的保护标志
Worksheet::setColumn -- 设置单列或多列的宽度
Worksheet::writeCol -- 把一组值输出一列
Worksheet::writeRow -- 把一组值输出一行
Worksheet::setSelection -- 设置工作表中选中的区域,一个或多个单元格
Worksheet::freezePanes -- 设置方格为不可用
Worksheet::thawPanes -- 设置方格为可用
Worksheet::hideScreenGridlines --隐藏线条
Worksheet::setPortrait -- 设置短的一边在顶端和底端
Worksheet::setLandscape -- 设置长的一边做顶和底
Worksheet::setPaper -- 设置纸张 9 = A4
Worksheet::setHeader -- 设置页眉
Worksheet::setFooter -- 设置页脚
Worksheet::setMerge --合并单元格
Worksheet::centerHorizontally -- 横排居中
Worksheet::centerVertically -- 竖排居中
Worksheet::setMargins -- 所有的设置页边距相同的值
Worksheet::setMargins_LR -- 设置所有的左右页边距相同的值
Worksheet::setMargins_TB -- 设置所有的顶底页边距相同的值
Worksheet::setMarginLeft -- 设置左边距
Worksheet::setMarginRight -- 设置右边距
Worksheet::setMarginTop -- 设置顶边距
Worksheet::setMarginBottom -- 设置底边距
Worksheet::repeatRows -- 设置相同的行
Worksheet::repeatColumns -- 设置相同的列
Worksheet::printArea -- 设置相同的区域
Worksheet::hideGridlines -- 隐藏区域线条
Worksheet::printRowColHeaders -- 设置头部
Worksheet::fitToPages -- 设置纵向和横向显示的页数
Worksheet::setHPagebreaks -- 置横向显示的页数
Worksheet::setVPagebreaks -- 设置纵向显示的页数
Worksheet::setZoom -- 设置工作表放大因子.
Worksheet::setPrintScale -- 设置为打印的页面比例因子
Worksheet::write -- 输出
Worksheet::writeNumber -- 输出数字
Worksheet::writeString -- 输出字符串
Worksheet::writeNote -- 输出注解
Worksheet::writeBlank -- 输出空白
Worksheet::writeFormula -- 输出公式
Worksheet::writeUrl -- 输出URL
Worksheet::setRow -- T设置行的高度或格式
Worksheet::mergeCells -- 合并单元格
Worksheet::insertBitmap -- 插入BMP文件
Worksheet::setOutline -- 加框
Format 格式
Format::setAlign -- 设置排列
Format::setVAlign -- 设置横向排列
Format::setHAlign -- 设置纵向排列
Format::setMerge -- 合并
Format::setLocked -- 加锁
Format::setUnLocked -- 去锁
Format::setBold -- 加粗
Format::setBottom -- 底框
Format::setTop -- 顶框
Format::setLeft -- 左框
Format::setRight -- 右框
Format::setBorder -- 边框
Format::setBorderColor -- 边框颜色
Format::setBottomColor -- 边框底部颜色
Format::setTopColor -- 边框顶部颜色
Format::setLeftColor -- 左边框颜色
Format::setRightColor -- 右边框颜色
Format::setFgColor -- 前景色
Format::setBgColor -- 背景色
Format::setColor -- 内容颜色
Format::setPattern --匹配
Format::setUnderline -- 下划线
Format::setItalic --斜体
Format::setSize --字体大小
Format::setTextWrap -- 缠绕
Format::setTextRotation -- 交替
Format::setNumFormat -- 数字格式化
Format::setStrikeOut -- 加强
Format::setOutLine -- 加框
Format::setShadow -- 阴影
Format::setScript --角本
Format::setFontFamily -- 字体
本文来自CSDN博客:http://blog.csdn.net/bakeloar/archive/2009/11/03/4759151.aspx
分享到:
相关推荐
Spreadsheet_Excel_Writer 生成excel 实例
php直接读excel Spreadsheet_Excel_Reader
excel_z2002h_spreadsheet_TheJust_excel_源码
Excel对比工具,安装后可以在Excel 加载项中直接使用比对工具。比较两个excel文档间的差异cell或者相同cell,以不同颜色标注。 Spreadsheet_Compare是在Excel文档对比中的最佳选择
Spreadsheet::ParseExcel 安装模块
This example demonstrates how to manipulate the generated file by making the text in the third column (C) bold using the styling options that are built into the created spreadsheet. jQuery is used to ...
Spreadsheet/Excel/Writer
Spreadsheet_Compare_Setup_v1.20.0
这是一个在线Excel的框架,可以自己往里面加入想要的功能,详情请参考Aspose官方的文档
下载后可以进行excel对比找到安装路径里面的Spreadsheet Compare.xlam,先打开excel,执行Spreadsheet Compare.xlam,执行宏定义,在最上面多一个加载项,点击compare,进行比对,如有不懂可参考我的博客
使用的是Spreadsheet_Excel_writer。使用前确保你的PEAR OLE有成功安装,或者直接使用类似XMAPP这种集成开发环境。使用集成环境也要点击PHP中的go-pear.bat进行安装,然后记得去修改下APACHE的BIN中的PHP.INI文件...
Spreadsheet_Excel 包括读取和写入
This app is written as a secondary school spreadsheet database app that saves and prints spreadsheets.
能够实现从excel表格中读取内容并存储在数组中
Office Spreadsheet Windev source code
This is a demo android app I did that pulls a value from a google spreadsheet and displays/tracks it. I use it to keep track of my networth, as I have a google spreadsheet that blends my portfolio and...
一个类似EXCEL电子表格VC类库。可以嵌入到MFC程序中增强列表控件显示功能。
Spreadsheet_Excel_Reader:PHP操作读取Excel文件的类。
这是一个非常简单易用的php读取excel... 使用方法: ... $xl_reader= new Spreadsheet_Excel_Reader(); $xl_reader->setOutputEncoding('GBK'); $xl_reader->read("Coupon_QQ_Uin.xls"); print_r($xl_reader->sheets[0]);
编译好的SpreadSheet动态库(亲测可用)