29 error_reporting(E_ALL);
30 ini_set(
'display_errors', TRUE);
31 ini_set(
'display_startup_errors', TRUE);
33 define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
35 date_default_timezone_set(
'Europe/London');
38 require_once dirname(__FILE__) .
'/../Classes/PHPExcel.php';
62 $objWriter->save(str_replace(
'.php',
'.xlsx', __FILE__));
63 echo date(
'H:i:s') ,
" File written to " , str_replace(
'.php',
'.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) ,
EOL;
66 echo date(
'H:i:s') ,
" Write to Excel5 format" ,
EOL;
68 $objWriter->save(str_replace(
'.php',
'.xls', __FILE__));
69 echo date(
'H:i:s') ,
" File written to " , str_replace(
'.php',
'.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) ,
EOL;
74 $objWriter->save(str_replace(
'.php',
'.htm', __FILE__));
75 echo date(
'H:i:s') ,
" File written to " , str_replace(
'.php',
'.htm', pathinfo(__FILE__, PATHINFO_BASENAME)) ,
EOL;
85 'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
87 'at the top of this script as appropriate for your directory structure' .
92 $objWriter->save(str_replace(
'.php',
'.pdf', __FILE__));
93 echo date(
'H:i:s') ,
" File written to " , str_replace(
'.php',
'.pdf', pathinfo(__FILE__, PATHINFO_BASENAME)) ,
EOL;
96 echo date(
'H:i:s') ,
' EXCEPTION: ', $e->getMessage() ,
EOL;
100 echo date(
'H:i:s') ,
" Removing first two heading rows for CSV export" ,
EOL;
107 $objWriter->save(str_replace(
'.php',
'.csv', __FILE__));
108 echo date(
'H:i:s') ,
" File written to " , str_replace(
'.php',
'.csv', pathinfo(__FILE__, PATHINFO_BASENAME)) ,
EOL;
111 echo date(
'H:i:s') ,
" Write to CSV format (with BOM)" ,
EOL;
113 $objWriter->save(str_replace(
'.php',
'-bom.csv', __FILE__));
114 echo date(
'H:i:s') ,
" File written to " , str_replace(
'.php',
'-bom.csv', pathinfo(__FILE__, PATHINFO_BASENAME)) ,
EOL;
118 echo date(
'H:i:s') ,
" Peak memory usage: " , (memory_get_peak_usage(
true) / 1024 / 1024) ,
" MB" , EOL;
122 echo 'Files have been created in ' , getcwd() ,
EOL;
const PDF_RENDERER_DOMPDF
static setPdfRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering PDF files.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$rendererName
Include PHPExcel.