質問編集履歴
5
一部誤りがあったため修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
ソースは以下になります。
|
12
12
|
|
13
|
-
※phpファイルと同ディレクトリ内に、
|
13
|
+
※phpファイルと同ディレクトリ内に、ユーザ一覧.xlsx(テンプレート)を配置し、
|
14
14
|
|
15
15
|
テンプレートファイルに情報を追加して、別名にて出力しようとしています。
|
16
16
|
|
4
エラー内容を修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -70,31 +70,37 @@
|
|
70
70
|
|
71
71
|
```
|
72
72
|
|
73
|
-
PS D:\php_pg>
|
74
|
-
|
75
73
|
PS D:\php_pg> php .\excel.php
|
76
74
|
|
77
|
-
PHP Fatal error: Uncaught PhpOffice\PhpSpreadsheet\
|
75
|
+
PHP Fatal error: Uncaught Error: Call to undefined function PhpOffice\PhpSpreadsheet\Reader\mime_content_type() in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Csv.php:516
|
78
76
|
|
79
77
|
Stack trace:
|
80
78
|
|
81
|
-
#0 D:\php_pg\e
|
79
|
+
#0 D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\IOFactory.php(147): PhpOffice\PhpSpreadsheet\Reader\Csv->canRead('\x83\x86\x81[\x83U\x88\xEA\x97\x97.xlsx')
|
82
80
|
|
83
|
-
#1
|
81
|
+
#1 D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\IOFactory.php(93): PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile('\x83\x86\x81[\x83U\x88\xEA\x97\x97.xlsx')
|
84
82
|
|
83
|
+
#2 D:\php_pg\excel.php(9): PhpOffice\PhpSpreadsheet\IOFactory::load('\x83\x86\x81[\x83U\x88\xEA\x97\x97.xlsx')
|
84
|
+
|
85
|
+
#3 {main}
|
86
|
+
|
85
|
-
thrown in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\
|
87
|
+
thrown in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Csv.php on line 516
|
86
88
|
|
87
89
|
|
88
90
|
|
89
|
-
Fatal error: Uncaught PhpOffice\PhpSpreadsheet\
|
91
|
+
Fatal error: Uncaught Error: Call to undefined function PhpOffice\PhpSpreadsheet\Reader\mime_content_type() in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Csv.php:516
|
90
92
|
|
91
93
|
Stack trace:
|
92
94
|
|
93
|
-
#0 D:\php_pg\e
|
95
|
+
#0 D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\IOFactory.php(147): PhpOffice\PhpSpreadsheet\Reader\Csv->canRead('\x83\x86\x81[\x83U\x88\xEA\x97\x97.xlsx')
|
94
96
|
|
95
|
-
#1
|
97
|
+
#1 D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\IOFactory.php(93): PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile('\x83\x86\x81[\x83U\x88\xEA\x97\x97.xlsx')
|
96
98
|
|
99
|
+
#2 D:\php_pg\excel.php(9): PhpOffice\PhpSpreadsheet\IOFactory::load('\x83\x86\x81[\x83U\x88\xEA\x97\x97.xlsx')
|
100
|
+
|
101
|
+
#3 {main}
|
102
|
+
|
97
|
-
thrown in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\
|
103
|
+
thrown in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Csv.php on line 516
|
98
104
|
|
99
105
|
PS D:\php_pg>
|
100
106
|
|
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,9 +28,9 @@
|
|
28
28
|
|
29
29
|
$todaystr = date('Ymd');
|
30
30
|
|
31
|
-
$input = '
|
31
|
+
$input = 'ユーザ一覧.xlsx';
|
32
32
|
|
33
|
-
$output = '
|
33
|
+
$output = 'ユーザ一覧_' . $todaystr . '.xlsx';
|
34
34
|
|
35
35
|
|
36
36
|
|
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
PS D:\php_pg>
|
74
74
|
|
75
|
-
PS D:\
|
75
|
+
PS D:\php_pg> php .\excel.php
|
76
76
|
|
77
77
|
PHP Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Writer\Exception: Could not open ユーザ一覧_20180831.xlsx for writing. in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Xlsx.php:218
|
78
78
|
|
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
#1 {main}
|
84
84
|
|
85
|
-
thrown in D:\
|
85
|
+
thrown in D:\php_pg\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Xlsx.php on line 218
|
86
86
|
|
87
87
|
|
88
88
|
|
1
ソースを一部修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,21 +26,11 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
|
29
|
+
$todaystr = date('Ymd');
|
30
30
|
|
31
|
+
$input = 'a.xlsx';
|
31
32
|
|
32
|
-
|
33
|
-
$today = date("Y/m/d");
|
34
|
-
|
35
|
-
$todaystr = date("Ymd");
|
36
|
-
|
37
|
-
$input = "ユーザ一覧.xlsx";
|
38
|
-
|
39
|
-
$output =
|
33
|
+
$output = 'a' . $todaystr . '.xlsx';
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
44
34
|
|
45
35
|
|
46
36
|
|
@@ -62,7 +52,7 @@
|
|
62
52
|
|
63
53
|
|
64
54
|
|
65
|
-
$writer =
|
55
|
+
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
66
56
|
|
67
57
|
$writer->save($output);
|
68
58
|
|