Now the correct example is called:
Sample_05_Chart_with_PHPExcel.php
in the samples folder inside the main PHPPowerpoint folder (now it starts to call it PHPPresentation)
Please note that for it to work you need to change / add a few things.
download from GitHub and save the Common
folder somewhere from PHPOffice
enable and register autoloader with Common
Download from GitHub and save the PHPExcel
folder PHPExcel
include main PHPExcel.php
file
In the Sample_Header.php
file Sample_Header.php
I changed the line
Autoloader::register();
to
PhpOffice\PhpPresentation\Autoloader::register();
to avoid conflicts (which autoloader are we registering?)
In the Sample_Header.php
file Sample_Header.php
I also deleted (commented out) the line:
//require_once __DIR__ . '/../vendor/autoload.php';
which gave me errors (I do not use a composer and do not want a composer).
That's all, now he is creating a Powerpoint presentation with editable Excel data inside.
This is the final code in the modified Sample_Header.php (lines 26-28):
PhpOffice\PhpPresentation\Autoloader::register();
This is the final code added in the modified Sample_05_Chart_with_PHPExcel.php (line 5, after include_once 'Sample_Header.php';
):
require_once '<path to phpExcel...>/Classes/PHPExcel.php'; include '<path to Common...>/Common/Autoloader.php'; PhpOffice\Common\Autoloader::register();
Change <path to phpExcel...>
and <path to Common...>
to the correct paths.
source share