LoginSignup
0
0

More than 5 years have passed since last update.

PHPでexcel出力メモ PhpSpreadsheetが使えない場合……

Last updated at Posted at 2018-12-28

何かPhpSpreadsheetがおすすめらしいが
https://qiita.com/suin/items/7a8d0979b7675d6fd05b
composerが現在インストール出来ていないので
他の方法としてやってみた事をメモらせて頂きます。

https://qiita.com/ao_love/items/33f4509654d3a19fe53e
記載の
ここからダウンロード
(2015.6.10時点での最新は1.8.0です)

処理に必要なのはClassesフォルダだけなので、解凍した後にClassesだけ処理を行うPHP付近に置けばOK
との事なのでやってみたのですが
```php
//ディレクトリ設定
$dir = './';//ここ

//ライブラリ読み込み
require_once $dir . '/Classes/PHPExcel.php';
require_once $dir . '/Classes/PHPExcel/IOFactory.php';

//テンプレート読み込み
//$file =$dir.'temp.xls';//テンプレート名
$file =$dir.'temp.xlsx';//テンプレート名
$reader = PHPExcel_IOFactory::createReader('Excel5');
```

Fatal error: Uncaught exception 'Exception' with message 'The filename ./temp.xlsx is not recognised as an OLE file' in /data/web/www/contents/Classes/PHPExcel/Shared/OLERead.php:87 Stack trace: #0 /data/web/www/contents/ma2/Classes/PHPExcel/Reader/Excel5.php(1183): PHPExcel_Shared_OLERead->read('./temp.xlsx') #1 /data/web/www/contents/ma2/Classes/PHPExcel/Reader/Excel5.php(689): PHPExcel_Reader_Excel5->_loadOLE('./temp.xlsx') #2 /data/web/www/contents/ma2/exportExcel.php(20): PHPExcel_Reader_Excel5->load('./temp.xlsx') #3 {main} thrown in /data/web/www/contents/ma2/Classes/PHPExcel/Shared/OLERead.php on line 87

だった……なぜーーーー

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0