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

相關文章

2 thoughts on “php-excel-writer

  1. 他有一個PEAR.php檔 我去下載卻沒發現這個檔案 這個檔案是? 我要自己寫嗎 還是
    我有點搞不太懂啥pear的東西..

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>