php - PHPExcel not well-formed -
hello i'm trying generate , download excel file via ajax, unfortunately i'm getting error not well-formed
, nothing more specific.. i've checked variables etc , i'm sure there aren't missing required values.. code calls phpexcel script..
$("#myform").submit(function(e) { var group_id = <?php echo $group_id; ?>; var month = <?php echo $month; ?>; var year = <?php echo $year; ?>; $.ajax({ url: 'ajax/events_to_excel.php?id='+group_id+'&m='+month+'&y='+year, type: 'post', data: $(this).serialize(), success: function(data, textstatus, jqxhr) { //console.log(data); }, error: function(jqxhr, textstatus, errorthrown) { } }). done(function(data) { }); e.preventdefault(); });
and ending header code generating excel document.. (i not show previous code know there ok , no errors, checked , working in different pages) part gives errors here header information..
// redirect output client’s web browser (excel2007) header('content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('content-disposition: attachment;filename="'.$file_name.'.xlsx"'); header('cache-control: max-age=0'); // if you're serving ie 9, following may needed header('cache-control: max-age=1'); // if you're serving ie on ssl, following may needed header ('expires: mon, 26 jul 1997 05:00:00 gmt'); // date in past header ('last-modified: '.gmdate('d, d m y h:i:s').' gmt'); // modified header ('cache-control: cache, must-revalidate'); // http/1.1 header ('pragma: public'); // http/1.0 $objwriter = phpexcel_iofactory::createwriter($objphpexcel, 'excel2007'); ob_end_clean(); $objwriter->save('php://output'); exit;
p.s. page isn't giving output.
Comments
Post a Comment