php-excel-writer

Spreadsheet_Excel_Writer 這個PEAR LIB,可以將PHP的資料輸出成Excel檔案。

最近剛好需要將資料庫裡的資料讓使用者下載成excel檔案,剛好這個Spreadsheet_Excel_Writer正好可以使用,網路上已經有很多的相關文章了,這裡就記一下我使用後的筆記。

安裝

PEAR 如果PHP是自己編譯的話在configure加入 –with-pear 然後重新編譯它
# ./configure –with-pear
# make
# make install

Package Information: OLE
Easy Install:pear install OLE-1.0.0RC1
# /usr/local/php/bin/pear install OLE-1.0.0RC1

Package Information: Spreadsheet_Excel_Writer
Easy Install:pear install Spreadsheet_Excel_Writer-0.9.1
# /usr/local/php/bin/pear install Spreadsheet_Excel_Writer-0.9.1

* 注意: /usr/local/php 是我安裝php的路徑

修正

修正 Spreadsheet_Excel_Writer 的 unicode 問題
# patch Workbook.php < patch file
# patch Format.php < patch file

修正 Spreadsheet_Excel_Writer 檔案超過大小

使用

可參考官網的範例

參考資料

http://blog.teatime.com.tw/1/post/301
http://blog.teatime.com.tw/1/post/111
http://www.ooso.net/archives/192
http://pear.php.net/package/Spreadsheet_Excel_Writer/docs

Related Posts with Thumbnails

相關文章