4

PEARSpreadsheet_Excel_WriterとOLEをインストールしました。サンプルプログラムは正常に実行されましたが、ファイルを読み取ろうとすると、ガベージ値が表示されます。私も試しまし$workbook->setVersion(8);$worksheet->setInputEncoding('UTF-8');

私はこのチュートリアルとこの問題のためにグーグルロットを使用しています。
http://www.sitepoint.com/article/getting-started-with-pear/3/

前もって感謝します。

4

2 に答える 2

2

私は本当に必要な場合にのみ PEAR を使用しようとしています...次のようなものを使用して、Excel スプレッドシート (単なるデータであると想定) を簡単に生成できます。

$header = "Last Name\tFirst Name\tAge\tJob\n"; // new line is start of new row, tab is next column

//ideally you would get this from a DB and just loop through it and append on
$row1 = "Smith\tBob\t25\tManager\n";
$row2 = "Anderson\tTrent\t32\tCEO\n";

$excel = $header.$row1.$row2;

$xlsfile = "excel_example".date("m-d-Y-hiA").".xls";
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=$xlsfile");
echo $excel;
于 2008-12-23T16:54:25.980 に答える