29 error_reporting(E_ALL);
30 ini_set(
'display_errors', TRUE);
31 ini_set(
'display_startup_errors', TRUE);
32 date_default_timezone_set(
'Europe/London');
34 define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
36 date_default_timezone_set(
'Europe/London');
39 require_once dirname(__FILE__) .
'/../Classes/PHPExcel.php';
43 echo date(
'H:i:s') .
" List implemented functions\n";
45 print_r(
$objCalc->listFunctionNames());
48 echo date(
'H:i:s') .
" Create new PHPExcel object\n";
52 echo date(
'H:i:s') .
" Add some data\n";
53 $objPHPExcel->getActiveSheet()->setCellValue(
'A14',
'Count:');
55 $objPHPExcel->getActiveSheet()->setCellValue(
'B1',
'Range 1');
59 $objPHPExcel->getActiveSheet()->setCellValue(
'B5', True);
60 $objPHPExcel->getActiveSheet()->setCellValue(
'B6', False);
61 $objPHPExcel->getActiveSheet()->setCellValue(
'B7',
'Text String');
62 $objPHPExcel->getActiveSheet()->setCellValue(
'B9',
'22');
67 $objPHPExcel->getActiveSheet()->setCellValue(
'B14',
'=COUNT(B2:B12)');
69 $objPHPExcel->getActiveSheet()->setCellValue(
'C1',
'Range 2');
82 $objPHPExcel->getActiveSheet()->setCellValue(
'C14',
'=COUNT(C2:C12)');
84 $objPHPExcel->getActiveSheet()->setCellValue(
'D1',
'Range 3');
89 $objPHPExcel->getActiveSheet()->setCellValue(
'D5',
'=((D2 * D3) + D4) & " should be 10"');
91 $objPHPExcel->getActiveSheet()->setCellValue(
'E1',
'Other functions');
92 $objPHPExcel->getActiveSheet()->setCellValue(
'E2',
'=PI()');
93 $objPHPExcel->getActiveSheet()->setCellValue(
'E3',
'=RAND()');
94 $objPHPExcel->getActiveSheet()->setCellValue(
'E4',
'=RANDBETWEEN(5, 10)');
96 $objPHPExcel->getActiveSheet()->setCellValue(
'E14',
'Count of both ranges:');
97 $objPHPExcel->getActiveSheet()->setCellValue(
'F14',
'=COUNT(B2:C12)');
100 echo date(
'H:i:s') .
" Calculated data\n";
101 echo 'Value of B14 [=COUNT(B2:B12)]: ' .
$objPHPExcel->getActiveSheet()->getCell(
'B14')->getCalculatedValue() .
"\r\n";
105 echo date(
'H:i:s') .
" Peak memory usage: " . (memory_get_peak_usage(
true) / 1024 / 1024) .
" MB\r\n";
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())
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.