PHPOffice/PHPExcel — pull request #226 by loki36 (2013-08-05 17:42:48+00:00)
Title: add read pivot table for excel2007

add read pivot table for excel2007 in order to not loose it. Pivot Table
is not editable
exemple
$objReader = PHPExcel_IOFactory::createReader('CSV')->setDelimiter(';')
->setEnclosure('"')
->setLineEnding("\r\n")
->setSheetIndex(0);

$objPHPExcelFromCSV = $objReader->load("fichier/tmp.csv");
$sheet1 = $objPHPExcelFromCSV->getSheet(0);
$sheet1->setTitle('data');

$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setIncludePivotTable(true);
$objPHPExcel =$objReader->load("template/template_Q.xlsx");

if($objPHPExcel->getSheetByName("data")){
$objPHPExcel->removeSheetByIndex(
$objPHPExcel->getIndex(
$objPHPExcel->getSheetByName("data")
)
);
}

// $objPHPExcel->addSheet($sheet1,0);
$objPHPExcel->addExternalSheet($objPHPExcelFromCSV->getSheet(0),0);

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,
'Excel2007');
$objWriter->setIncludePivotTable(true);
$objWriter->save("test.xlsx");