PHPPowerpoint chart with excel (Sample 8) not working

263 Views Asked by At

I'm using this library, to create PowerPoint presentations with Charts in them using PHP. I intend to have the chart data editable (with an embed excel sheet).

I'm new to the library and still trying to figure out how exactly to go about it. The samples folder has a few helpful examples however "sample 8"(Chart with PHPExcel) does not work.

It give me the following error

PHPExcel has not been loaded. Include PHPExcel.php in your script, 
e.g. require_once 'PHPExcel.php'.

I understand it probably means I also need to install PHPExcel and integrate it with PhpPowerpoint. But am unable to figure out how.

Things I've tried so far

  1. Copy the contents of PhpExcel to the samples folder and include_once 'PhpExcel.php'; in the Sample_08_Chart_with_PHPExcel.php.

This gave me the following error

Fatal error: Class 'PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\PHPExcel_Cell' not found in C:\xampp\htdocs\PHPPowerpoint_1\PHPPowerPoint-0.3.0\PHPPowerPoint-0.3.0\src\PhpPowerpoint\Writer\PowerPoint2007\Chart.php on line 938

  1. Copied the contents of PhpExcel to the 'src' folder of 'PhpPowerpoint' and include_once 'PhpExcel.php'; on the 'PhpPowerpoint.php' file, still got the same error.

  2. A few more combinations of locations and inclusions in files but it all gives me the same error.

So the questions is

  1. Where should I place the PHPExcel files
  2. in which file from PhpPowerpoint should I include PHPExcel.php
1

There are 1 best solutions below

5
Mark Baker On

Place the PHPExcel library wherever you want in your folder structure, though I'd recommend putting it in a separate subfolder at least, where you don't have any other libraries installed already... it's a separate library, so should be treated separately

You include PHPExcel.php in your own script, not in any of the PHPowerPoint scripts