29 error_reporting(E_ALL);
30 ini_set(
'display_errors', TRUE);
31 ini_set(
'display_startup_errors', TRUE);
32 date_default_timezone_set(
'Europe/London');
34 if (PHP_SAPI ==
'cli')
35 die(
'This example should only be run from a Web Browser');
38 require_once dirname(__FILE__) .
'/../Classes/PHPExcel.php';
45 $objPHPExcel->getProperties()->setCreator(
"Maarten Balliauw")
46 ->setLastModifiedBy(
"Maarten Balliauw")
47 ->setTitle(
"Office 2007 XLSX Test Document")
48 ->setSubject(
"Office 2007 XLSX Test Document")
49 ->setDescription(
"Test document for Office 2007 XLSX, generated using PHP classes.")
50 ->setKeywords(
"office 2007 openxml php")
51 ->setCategory(
"Test result file");
56 ->setCellValue(
'A1',
'Hello')
57 ->setCellValue(
'B2',
'world!')
58 ->setCellValue(
'C1',
'Hello')
59 ->setCellValue(
'D2',
'world!');
63 ->setCellValue(
'A4',
'Miscellaneous glyphs')
64 ->setCellValue(
'A5',
'éàèùâêîôûëïüÿäöüç');
75 header(
'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
76 header(
'Content-Disposition: attachment;filename="01simple.xlsx"');
77 header(
'Cache-Control: max-age=0');
79 header(
'Cache-Control: max-age=1');
82 header (
'Expires: Mon, 26 Jul 1997 05:00:00 GMT');
83 header (
'Last-Modified: '.gmdate(
'D, d M Y H:i:s').
' GMT');
84 header (
'Cache-Control: cache, must-revalidate');
$objPHPExcel
Include PHPExcel.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Add a drawing to the header