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');
9 define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
11 date_default_timezone_set(
'Europe/London');
40 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
43 include
'PHPExcel/IOFactory.php';
62 'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
64 'at the top of this script as appropriate for your directory structure' 81 'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
83 'at the top of this script as appropriate for your directory structure' 91 if ((isset($argc)) && ($argc > 1)) {
93 for(
$i = 1;
$i < $argc; ++
$i) {
100 $inputFileNameShort = basename($inputFileName);
102 if (!file_exists($inputFileName)) {
103 echo
date(
'H:i:s') ,
" File " , $inputFileNameShort ,
' does not exist' ,
EOL;
107 echo
date(
'H:i:s') ,
" Load Test from $inputFileType file " , $inputFileNameShort ,
EOL;
114 echo
date(
'H:i:s') ,
" Iterate worksheets looking at the charts" ,
EOL;
117 echo
'Worksheet: ' , $sheetName ,
EOL;
120 if(empty($chartNames)) {
121 echo
' There are no charts in this worksheet' ,
EOL;
123 natsort($chartNames);
124 foreach($chartNames as
$i => $chartName) {
126 if (!is_null(
$chart->getTitle())) {
127 $caption =
'"' . implode(
' ',
$chart->getTitle()->getCaption()) .
'"';
129 $caption =
'Untitled';
131 echo
' ' , $chartName ,
' - ' , $caption ,
EOL;
132 echo str_repeat(
' ',strlen($chartName)+3);
133 $groupCount =
$chart->getPlotArea()->getPlotGroupCount();
134 if ($groupCount == 1) {
135 $chartType =
$chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
136 echo
' ' , $chartType ,
EOL;
138 $chartTypes =
array();
139 for(
$i = 0;
$i < $groupCount; ++
$i) {
140 $chartTypes[] =
$chart->getPlotArea()->getPlotGroupByIndex(
$i)->getPlotType();
142 $chartTypes = array_unique($chartTypes);
143 if (count($chartTypes) == 1) {
144 $chartType =
'Multiple Plot ' . array_pop($chartTypes);
145 echo
' ' , $chartType ,
EOL;
146 } elseif (count($chartTypes) == 0) {
147 echo
' *** Type not yet implemented' ,
EOL;
149 echo
' Combination Chart' ,
EOL;
157 $outputFileName = str_replace(
'.xlsx',
'.pdf', basename($inputFileName));
159 echo
date(
'H:i:s') ,
" Write Tests to HTML file " ,
EOL;
163 echo
date(
'H:i:s') ,
" File written to " , $outputFileName ,
EOL;
170 echo
date(
'H:i:s') ,
' Peak memory usage: ' , (memory_get_peak_usage(
true) / 1024 / 1024) ,
" MB" ,
EOL;
173 echo
date(
'H:i:s') ,
" Done writing files" ,
EOL;
174 echo
'Files have been created in ' , getcwd() ,
EOL;
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 setChartRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering charts.
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())
if(!PHPExcel_Settings::setChartRenderer($rendererName, $rendererLibraryPath)) $inputFileType
Create styles array
The data for the language used.
$rendererName
PHPExcel_IOFactory.
const CHART_RENDERER_JPGRAPH
Optional Chart Rendering libraries.