ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
27imagesexcel5.php
Go to the documentation of this file.
1<?php
29error_reporting(E_ALL);
30ini_set('display_errors', TRUE);
31ini_set('display_startup_errors', TRUE);
32
33define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34
35date_default_timezone_set('Europe/London');
36
38require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
39
40
41// Read from Excel5 (.xls) template
42echo date('H:i:s') , " Load Excel2007 template file" , EOL;
44$objPHPExcel = $objReader->load("templates/27template.xls");
45
46// Export to Excel2007 (.xlsx)
47echo date('H:i:s') , " Write to Excel5 format" , EOL;
49$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
50echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
51
52// Export to Excel5 (.xls)
53echo date('H:i:s') , " Write to Excel5 format" , EOL;
55$objWriter->save(str_replace('.php', '.xls', __FILE__));
56echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
57
58
59// Echo memory peak usage
60echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
61
62// Echo done
63echo date('H:i:s') , " Done writing files" , EOL;
64echo 'Files have been created in ' , getcwd() , EOL;
memory_get_peak_usage(true)/1024/1024)
const EOL
$objReader
$objWriter
$objPHPExcel
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Definition: IOFactory.php:132
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
Definition: IOFactory.php:161