Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing a frame.

Status
Not open for further replies.
Apr 27, 1999
705
US
Hello,

I'm using a frameset with Frame 1 selecting records to download from an SQL database. In Frame 2, it's being displayed. This works fine if I'm just displaying in html format, however I need to display the format in Excel format using "application/vnd.ms-excel". I get the following message when I try to download a subsequent Excel sheet. "A document with the same name is already open. You cannot open two documents with the same name... Either close the document that's currently open or rename one of the documents". Do I need to close "frame 2". How can I achieve this? Thanks.

Fengshui1998
 
It's "feature" :) of Excel.
You can select one of following solutions:
1. Just don't do it. This is best solution. Your page will be viewable on other systems.
2. Use some redirect page before displaying xls to get Excel enough time to close previous file.
3. Have two names for same script that returns your xls, and switch between them in script from first frame.
 
DubnerM,

Thanks for your comments, but I did get it to work for thos who are interested. Instead of doing a POST to the asp page, I wrote a subroutine with a URL location. With IE, the table appears in EXCEL format in the frame. With NETSCAPE, it opens the EXCEL app., but I can choose subsequent records to display without any problems.

<script language=&quot;javascript&quot;>
function nav() {
var sortby
var frmt
if (document.elogview.sortby[0].checked) { sortby=1;}
if (document.elogview.sortby[1].checked) { sortby=2;}
if (document.elogview.sortby[2].checked) { sortby=3;}
if (document.elogview.frmt[0].checked) { frmt=1;}
if (document.elogview.frmt[1].checked) { frmt=2;}
parent.frm2.location=&quot;Display_Elogs.asp?sortby=&quot; + sortby + &quot;&Frmt=&quot; + frmt
}
</script>

Fengshui1998
 
Sorry to say, I didn't understand - you have already solved your problem, or the last two of proposed solutions doesn't works for you for some reason? [sig]<p>Michael Dubner<br>Brainbench MVP/HTML+JavaScript<br>
[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top