5ini_set(
'display_errors', TRUE);
6ini_set(
'display_startup_errors', TRUE);
7date_default_timezone_set(
'Europe/London');
9define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
11date_default_timezone_set(
'Europe/London');
40set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
43include
'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'
91if ((isset($argc)) && ($argc > 1)) {
93 for($i = 1; $i < $argc; ++$i) {
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;
173echo
date(
'H:i:s') ,
" Done writing files" ,
EOL;
174echo
'Files have been created in ' , getcwd() ,
EOL;
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
memory_get_peak_usage(true)/1024/1024)
if(!PHPExcel_Settings::setChartRenderer($rendererName, $rendererLibraryPath)) $inputFileType
$rendererName
PHPExcel_IOFactory.
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
static setChartRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering charts.
const CHART_RENDERER_JPGRAPH
Optional Chart Rendering libraries.
static setPdfRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering PDF files.