I have a webpage that displays data from a SQL database in table
format. I found information on how to create a way to allow a user to
download this information to Excel using 'Header()' in the PHP code.
Header("Content-Type: application/vnd.ms-excel");
Header("Content-Disposition: attachment;
filename=\"file name.xls\"");
I setup a link on the display page that sends the variables needed for
the SQL query to a different PHP page and the link is targeted to a
bogus target window (target="excel" ) so that it doesn't change my
current display. This is meant for people who find the proper display
they want and then want to save it but also want to continue display
other data in the current window.
If the user clicks the link it then opens a browser window and prompts
the user with the typical IE download prompts, which is fine. But if
the user chooses to 'Save' the file to his/her pc and then goes
through the steps to save it, the browser window that was opened
doesn't automatically close. If the user chooses to open the .xls or
chooses to cancel the download, then the browser window closes just
fine.
Any suggestions as to how to alleviate this problem?
format. I found information on how to create a way to allow a user to
download this information to Excel using 'Header()' in the PHP code.
Header("Content-Type: application/vnd.ms-excel");
Header("Content-Disposition: attachment;
filename=\"file name.xls\"");
I setup a link on the display page that sends the variables needed for
the SQL query to a different PHP page and the link is targeted to a
bogus target window (target="excel" ) so that it doesn't change my
current display. This is meant for people who find the proper display
they want and then want to save it but also want to continue display
other data in the current window.
If the user clicks the link it then opens a browser window and prompts
the user with the typical IE download prompts, which is fine. But if
the user chooses to 'Save' the file to his/her pc and then goes
through the steps to save it, the browser window that was opened
doesn't automatically close. If the user chooses to open the .xls or
chooses to cancel the download, then the browser window closes just
fine.
Any suggestions as to how to alleviate this problem?
Comment