471,075 Members | 850 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

Self.close not working IE6.0.28...

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

Jul 23 '05 #1
1 3478
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.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by bruce stockwell | last post: by
2 posts views Thread by Clive Moore | last post: by
4 posts views Thread by Raymond Wilk | last post: by
2 posts views Thread by Kathy Burke | last post: by
1 post views Thread by oliver gargour | last post: by
1 post views Thread by liu | last post: by
1 post views Thread by michal.podlewski | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.