<?
/*
Autor: Lic. Carlos Alberto Vaca Coronado
Version: 3.2.0
*/

session_name('portal_absa');
session_start();
error_reporting(E_ALL);
require("Spreadsheet/Excel/Classes/PHPExcel.php");
require "Spreadsheet/Excel/Classes/PHPExcel/IOFactory.php";


$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("GenXII_WEB")
							 ->setLastModifiedBy("GenXII_WEB")
							 ->setTitle("Office 2007 XLSX")
							 ->setSubject("Office 2007 XLSX")
							 ->setDescription("Document for Office 2007 XLSX")
							 ->setKeywords("office 2007")
							 ->setCategory("Result file");
include "hojaExcel.php";

$objPHPExcel->setActiveSheetIndex(0);
//header('Content-Type: application/vnd.ms-excel');
header('Content-Type: application/force-download');
header('Content-Disposition: attachment;filename="'.$_POST['file_name'].'.xlsx"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
//$objWriter->save('test.xls');
?>