hello all
i am trying to create an excel report file to download
i have saw few examples in this site and work with them,
this is whats going on:
main.php have a form that the user choose date to extract his report,
then with ajax i return the table affter being generated from mysql.
the code that i echo to the ajax request is a <table> tag.
the problem is that affter i echo the table i also want to echo the excel,
[CODE=php]if($xls_file==" 1"){//if the user want excel file aswell
$xlsxls = header("Content-type: application/msexcel");
$xlsxls .= header("Content-Disposition: attachment; filename=xldoc. xls");
$xlsxls .= $final;//thats the <table> that ajax echo
echo $xlsxls;
}[/CODE]
this just produce the same table twice, is there a way to tell ajax to open it in a new window i belive that will solve it.
is there other solution?
i am trying to create an excel report file to download
i have saw few examples in this site and work with them,
this is whats going on:
main.php have a form that the user choose date to extract his report,
then with ajax i return the table affter being generated from mysql.
the code that i echo to the ajax request is a <table> tag.
the problem is that affter i echo the table i also want to echo the excel,
[CODE=php]if($xls_file==" 1"){//if the user want excel file aswell
$xlsxls = header("Content-type: application/msexcel");
$xlsxls .= header("Content-Disposition: attachment; filename=xldoc. xls");
$xlsxls .= $final;//thats the <table> that ajax echo
echo $xlsxls;
}[/CODE]
this just produce the same table twice, is there a way to tell ajax to open it in a new window i belive that will solve it.
is there other solution?
Comment