ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
34chartupdate.php
Go to the documentation of this file.
1 <?php
2 
4 error_reporting(E_ALL);
5 ini_set('display_errors', TRUE);
6 ini_set('display_startup_errors', TRUE);
7 date_default_timezone_set('Europe/London');
8 
9 define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
10 
11 date_default_timezone_set('Europe/London');
12 
40 require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
41 
42 if (!file_exists("33chartcreate-bar.xlsx")) {
43  exit("Please run 33chartcreate-bar.php first." . EOL);
44 }
45 
46 echo date('H:i:s') , " Load from Excel2007 file" , EOL;
48 $objReader->setIncludeCharts(TRUE);
49 $objPHPExcel = $objReader->load("33chartcreate-bar.xlsx");
50 
51 
52 echo date('H:i:s') , " Update cell data values that are displayed in the chart" , EOL;
53 $objWorksheet = $objPHPExcel->getActiveSheet();
54 $objWorksheet->fromArray(
55  array(
56  array(50-12, 50-15, 50-21),
57  array(50-56, 50-73, 50-86),
58  array(50-52, 50-61, 50-69),
59  array(50-30, 50-32, 50),
60  ),
61  NULL,
62  'B2'
63 );
64 
65 // Save Excel 2007 file
66 echo date('H:i:s') , " Write to Excel2007 format" , EOL;
68 $objWriter->setIncludeCharts(TRUE);
69 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
70 echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
71 
72 
73 // Echo memory peak usage
74 echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
75 
76 // Echo done
77 echo date('H:i:s') , " Done writing file" , EOL;
78 echo 'File has been created in ' , getcwd() , EOL;
$objWriter
$objWorksheet
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
Definition: IOFactory.php:161
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Definition: IOFactory.php:132
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())
Create styles array
The data for the language used.
$objReader
const EOL
$objPHPExcel