I am having a small problem publishing to excel
[code=php]
<?php
error_reporting(E_ALL);
date_default_timezone_set(‘America/New_York’);
/** PHPExcel */
require_once ‘classes/opendb.php’;
require_once ‘classes/class.database.php’;
require_once ‘classes/PHPExcel.php’;
// Create new PHPExcel object
$database = new database();
$objPHPExcel = new PHPExcel();
$alphas = range(‘A’, ‘Z’);
$tablename = $_GET[‘t’];
$filenum = $_GET[‘f’];
$stat = $_GET[‘s’];
$end = $_GET[‘e’];
$data = $database->get_table_headers($tablename);
$output = “<table> n”;
$output .= “<tr> n”;
for($i=0;$i < count($data);$i++){
$output .= “<td>” . $data[$i][0] . “</td> n”;
}
$output .= “</tr>n”;
$output .= “<tr>n”;
$output .= “<td>n”;
$data = $database->get_data_from_to($tablename,$stat,$end);
for($i=0;$i < count($data);$i++){
$output .= “<tr>n”;
for($ii=0;$ii < count($data[$i]);$ii++){
$output .= “<td>”. $data[$i][$ii] .”</td>n”;
}
$output .= “</tr>n”;
}
$output .= “</table>n”;
echo($output);
header(‘Content-Type: application/vnd.ms-excel’);
header(“Content-Disposition: attachment;filename=”.date(“U”).”_simple.xls”);
header(‘Cache-Control: max-age=0’);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, ‘Excel5’);
//$objWriter->save(‘php://output’);
exit;
?>