Self.close not working IE6.0.28...

S

Steven

I have a webpage where the user enters parameters for a report. This
page then post to a 2nd page. In this second page is the code to
create the report. The output of the page when it is complete should
open the report(in excel or snapshot) and then close the page.
From the prompt page the post looks like this:
<FORM NAME='frmReportpr' method=POST
action=\aspobjects\ReportPreview.asp target='_blank'>


the ReportPreview page looks like this:
<%
'DECLARTION OF VARIABLES
......

Set oReport = CreateObject("GPReport.clsReport")
'SUBMITT THE REQUEST TO THE REPORT QUEUE SERVER
If ( oReport.RequestReport(Cstr(strReportQueueServer),
CStr(strReportType), Cstr(strWebGroupName), CStr(strInputFileName),
CStr(strReportName), CStr(strSQL), Cstr(strAppName), 180)= True) then
'IF THE REQUEST WAS SUBMITTED SUCCESSFULLY, CHECK TO SEE WHAT TYPE OF
REPORT YOU ARE
filepath = replace(oReport.ReportName, "\", "\\")

%>
<script language="javascript">
window.setInterval(self.close, 2000);
var shell=new ActiveXObject("WScript.Shell");
cmdpath = "\"<%= filepath %>\" "
//alert(cmdpath)
shell.Run(cmdpath,1);
//alert('Closing the Window');
window.setInterval(self.close, 2000);
</script>
<%
Else


The report runs fine, and opens in snapshot or excel. However I am
left with a blank page in a new instance of the browser. On some
computers the new browsers closes????????

Any ideas?????

Thanks
 
L

Lee

Steven said:
window.setInterval(self.close, 2000);

If the page that is trying to close was opened by script, rather than by a link,
then you should be able to close it with:

setTimeout("self.close()", 2000);

setInterval() would also work, but is really intended for recurring events.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top