Thanks for the response. I tried it and get prompted TWICE do you want to open or save. How can I get rid of the second annoying prompt.
trainmom
Main Topics
Browse All TopicsI am getting "strange behaviors" while trying to open an excel worksheet in IE.
Several machines running 2000; NT4.0 with IE 5.50 sp2 and IE 6.0 work fine; but others
running with IE5.50 sp2 and IE6.0 don't work properly. I have checked to make sure the xls extension is associated with excel and that excel is in fact not ms-excel, etc. But I am obviously overlooking something.
I get the dialog to open or save the file(Saving the file works fine--but, we don't really want folks to save the file)
But when I clink Open --- Excel does load and I get "Error Occurred while processing Request" and it says it cannot find a date (this is a bogus error since it works when saving is selected) Also, the worksheet name is not what I expected. I get the Name of the PrintMyFileToExcel.cfm and not "PUMPED.xls"
This is the code I have been using:
<cfsetting enablecfoutputonly="Yes">
<cfset tabchar = chr(9)>
<cfset newline = chr(13) & chr(10)>
<cfcontent type="application/excel">
<cfheader name="content-disposition"
I get the same results when I add " inline" to the code I get to:
<cfheader name="content-disposition"
BUt, when I use attachment:
<cfheader name="content-disposition"
The Prompts to open or save appear TWICE and this is a real bore. How can I eliminate one of the prompts?
Can someone help me out here and straightened out?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
What is appears to be doing is loading the action "ReporInExcel.cfm" in the browser as well as the pumped.xls Excel report, thus getting 2 prompts. How do I stop the ReportinExcel.cfm from loading.
First, there is a form to enter date range:
basic Content of the getdate.cfm:
--------------
<cfform action="Reportinexcel.cfm"
<cfinput type="Text" name="getfrmdate" validate="date" value="#mgetbegdate#" > <cfinput type="Text" name="gettodate" validate="date" value="#mgetenddate#" >
<div align="center"><input type="submit" name="submit" value="Show Report in Excel SpreadSheet"></div>
</cfform>
----------------
Now: Content for the ReportInExcel.cfm:
-----------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfsetting enablecfoutputonly="Yes">
<cfset tabchar = chr(9)>
<cfset newline = chr(13) & chr(10)>
<cfcontent type="application/excel">
<cfheader name="content-disposition"
<cfset RptDatefrm = form.getfrmdate>
<cfset RptDateto = form.gettodate>
<cfquery name="maxpumped" datasource="wwtppumped">
select adata,bdata,cdata from treated
WHERE (activity_dt #RptDateOpfrm# #CreateODBCDate(RptDatefrm
</cfquery>
<html>
<head><title>Home Page</title></head>
<body>
<cfoutput>
Pumped for Query dates #RPTDATEOPfrm# #rptdatefrm# and #RPTDATEOPto# #rptdateto#
</cfoutput>
<cfoutput>
<table border="1" >
<tr><td> </td></tr>
</table>
</cfoutput>
<cfoutput query="maxpumped">
<table border="1">
<tr align="right">
<td><font size="+1"><font color="Blue">Date</font></
<td><font size="+1">Plant A</font></td>
<td><font size="+1">Plant B</font></td>
<td><font size="+1">Plant C</font></td>
</tr>
</cfoutput>
<cfoutput query="maxpumped">
<table border="1" >
<tr>
<td>#dateformat(activity_d
<td>#adata#</td>
<td>#bdata#</td>
<td>#cdata#</td>
</tr>
</table>
</cfoutput>
<cfsetting enablecfoutputonly="No">
</body>
</html>
THANKS for YOUR HELP.
OOPS ... I see that u have ur update query & output on the same page
what u can do is try it like this !
on ur "Reportinexcel.cfm" page show the output to the user & give him a link to download the file like this
<a href="download.cfm?sfile=p
Save this code as it is in a file called download.cfm
--------------------------
<CFHEADER NAME="content-disposition"
<!--- sfile - Name of file to be downloaded. --->
<CFCONTENT TYPE="application/octet-st
<!--- get teh physical path for the file to be downloaded. --->
--------------------------
PS : JFYI - its not a good idea to have ur update query & display form in the same page
cos if the user refreshes teh page - ur query will be fired once again - resulting in unwanted errors or records inserted in ur table.
let me know ...
K'Rgds
Anand
Anand,
I am sorry I really don't understand, I don't think I have update query and display on same page.
In file getdate.cfm--I ask user for a date range and then they click button which triggers the ReportinExcel.cfm.
In ReportInExcel.cfm ---I just query the database for the records meeting the date range and then output them.
It works fine in some browsers (users get only one prompt) when I take out the word "attachment" ; but in some browsers without the word attachment they get a bogus error.
Is there a switch or setting I need to change in the browser or in Excel?
When I include the word "attachment" then ALL users in ALL browsers get 2 prompts.
Is there a specific order to the <cfheader> and <cfcontent> usage?
Thanks Again.
Sorry I read ur select query as update query - my apologies !
but did u try the steps i had given u - abt calling download.cfm using href ... try it !
I had a similar problem [2 pop ups] when downloading particular file types for the first time
it gives a promt - if u say a yes for that filetype .. then after that u'll only get promted once for the attatchment.
see if it helps u as well
K'Rgds
Anand
ok i guess we went on the complicated route - if it wasnt for download
u can try this :
<html>
<head>
<title>Untitled</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
window.open('http://www.ur
//-->
</SCRIPT>
<TABLE BORDER="1">
<TR>
<TD> </TD>
<TD> </TD>
</TR>
</TABLE>
</body>
</html>
since u mentioned u just wanted to open it
does this help ???
K'Rgds
Anand
ok i guess we went on the complicated route - if it wasnt for download
u can try this :
<html>
<head>
<title>Untitled</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
window.open('http://www.ur
//-->
</SCRIPT>
<TABLE BORDER="1">
<TR>
<TD> </TD>
<TD> </TD>
</TR>
</TABLE>
</body>
</html>
since u mentioned u just wanted to open it
does this help ???
K'Rgds
Anand
Business Accounts
Answer for Membership
by: anandkpPosted on 2003-06-18 at 11:13:33ID: 8751325
try using the following code & let me know
PED.xls">
VALUE="attachment; filename=#sfile#">
ream" FILE="#sPath#" DELETEFILE="FALSE" RESET="TRUE">
PS : set the path for PUMPED.xls based on ur physical path or ur HDD
<!--- pass the following 2 parameters & call this file as a TAG / Include / HREF
<CFSET sPath = "C:\Clients\ProjFolder\PUM
<CFSET sfile = "PUMPED.xls"> --->
<CFHEADER NAME="content-disposition"
<!--- sfile - Name of file to be downloaded. --->
<CFCONTENT TYPE="application/octet-st
<!--- get teh physical path for the file to be downloaded. --->
K'Rgds
Anand