Problem with open xlsx file with chart embeded

Topics: User Forum
Oct 23, 2009 at 8:24 PM
Edited Oct 23, 2009 at 8:26 PM

Hi, I'm having the following problem:

 

The situation:

I've created a XLSX (Excel 2007) file wich contains a graphic chart localy in my computer.

When I open this file an re-write it, the graphic chart disapears.

Please, can you help my with this?

 

Here is the code that I'm using:

 

<?php

error_reporting(E_ALL);
ini_set('include_path', ini_get('include_path').';../Classes/');
include 'PHPExcel.php';
include 'PHPExcel/IOFactory.php';
include 'PHPExcel/Writer/Excel2007.php';
include 'PHPExcel/Reader/Excel2007.php';

$objPHPExcel = new PHPExcel();
$creator = "NAME";
$title = "TITLE";

$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(false);
$objPHPExcel = $objReader->load("name.xlsx");
$objPHPExcel->getActiveSheet();

 
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->SetCellValue('A25', '#');
$objPHPExcel->getActiveSheet()->SetCellValue('D25', 'Merge');

$objPHPExcel->getActiveSheet()->getStyle('A25:D25')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);


$objPHPExcel->getActiveSheet()->setTitle($title);

 
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=teste.xlsx");
header("Content-Transfer-Encoding: binary");

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save("php://output");
?>

 

 

 

Coordinator
Oct 23, 2009 at 8:57 PM

There's no quick solution for this!

PHPExcel does not currently support charts; and while work is currently in progress on this feature, we can't promise any date for its release.