Sep 21, 2014 at 11:10 AM
Edited Sep 21, 2014 at 2:14 PM
Hi, first time here.
I have an xlsx file which holds a simple table and a line chart. What I hope to be able to do is fill the values in from a database to update the chart (I'm not at that stage yet). As I am new to PHPExcel and finding my way with the library, what I have done
is simply created the table with some random numbers except for 1 cell and a line chart. I open my browser, point to my php file and what I want to happen is that a new file is created with a random number generated by php in the empty cell, chart is updated
with the new number and save it as result.xlsx. I'm at the early stages of learning here!!
Everything works except I can't get the chart generated in the new file even though it is already there in the initial file. The only thing I have left in the new file is the updated table.
No errors are reported so I'm not sure where I'm going wrong.
php version 5.4.24
Checked my phpinfo() and all is enabled (ie php.zip, php.xml, php.gd)
My code is;
/* Error reporting
$inputFileName = 'Gas Exception Report.xlsx';
//$objPHPExcel=$objPHPExcel_new = new PHPExcel();
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
Appreciate any help, regards
I tried the examples which came with PHPExcel and all worked. I changed the first chart example and saved it with my own chart and table. It produces a new file but with the following error when opening
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<summary>Errors were detected in file 'C:\Apache24\htdocs\Tests\32readwriteAreaChart1.xlsx'</summary>
<removedParts summary="Following is a list of removed parts:">
<removedPart>Removed Part: /xl/drawings/drawing1.xml part. (Drawing shape)</removedPart>
Still baffled but will persevere!!!!