How to close a window after downloaded/saved a file
Posted on 2005-03-03
Currently I have 3 pages:
Main.aspx – a page to let the user to choose report selection criteria, if the user click button “Print”, it will open a new window PleaseWait.aspx and pass the relevant selection criteria.
PleaseWait.aspx – a page only show a label “Report is being generated, please wait” and a progress bar gif, after the page is loaded for 3 seconds, it will redirect to Report.aspx and pass the releveant selection criteria.
Report.aspx – a page generates and shows the report according to the selection criteria, report format is either PDF or Excel (using Active Report).
It works fine if the report format is PDF as the PDF file will be redirected to show on the PleaseWait.aspx.
But if it is an excel format, the IE will automatically popup a dialog box asking if you want to “open”, ‘save”, or “cancel” the file. If you choose “save”, the PleaseWait.aspx will be still there and the “please wait…” message is still there after saved it?! It’s impossible to ask the user to open the Excel file instead of save it as there is no tool bar and save button on the top of the excel page…
My question is how do you know when the user choose “open” or “save” or “cancel” in this case? And how to you close the window if the user choose save?
Or, if there is any suggestion or solution to show the wait message while the report is generating and hide the message after report has been generated?