473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

using asp to generate excel = bad stuff

Hi, I am using the code below to create an excel document from data
that is returned from an sql query. The formatting of the excel
document is pretty and all is good unless I hit the back button and
run my query a second time, or a third time (I haven't made it past 3
times). Basically what happens is every time I do this, excel does
not close once I hit my back button. Does anyone have a solution to
this problem? Another problem is that when I run the query it just
opens excel within my browser, is there any way to make it ask if you
want to save or open the file? Thank You.

I basically throw this code at the top of the html doc:

<%
'Change HTML header to specify Excel's MIME content type
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
%>
Jul 19 '05 #1
2 5709
SPA
Hi

For your second problem, you could probably have a script code:

<SCRIPT Language="Javascript">
var resp;
resp = confirm("Do you want to open Excel file?");
if (resp)
window.open("Excelfile.xls", "_new", "width=300, height=300,
resizable=yes");
</SCRIPT>

This will execute the opening of your excel sheet in a separate window based
on your input.

HTH
SPA

"Jeremy" <ok********@hotmail.com> wrote in message
news:3a**************************@posting.google.c om...
Hi, I am using the code below to create an excel document from data
that is returned from an sql query. The formatting of the excel
document is pretty and all is good unless I hit the back button and
run my query a second time, or a third time (I haven't made it past 3
times). Basically what happens is every time I do this, excel does
not close once I hit my back button. Does anyone have a solution to
this problem? Another problem is that when I run the query it just
opens excel within my browser, is there any way to make it ask if you
want to save or open the file? Thank You.

I basically throw this code at the top of the html doc:

<%
'Change HTML header to specify Excel's MIME content type
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
%>

Jul 19 '05 #2
Thank You, this part worked, but I am still having the other problem.

-Jeremy

"SPA" <sh***********@usswi.com> wrote in message news:<uR*************@TK2MSFTNGP10.phx.gbl>...
Hi

For your second problem, you could probably have a script code:

<SCRIPT Language="Javascript">
var resp;
resp = confirm("Do you want to open Excel file?");
if (resp)
window.open("Excelfile.xls", "_new", "width=300, height=300,
resizable=yes");
</SCRIPT>

This will execute the opening of your excel sheet in a separate window based
on your input.

HTH
SPA

"Jeremy" <ok********@hotmail.com> wrote in message
news:3a**************************@posting.google.c om...
Hi, I am using the code below to create an excel document from data
that is returned from an sql query. The formatting of the excel
document is pretty and all is good unless I hit the back button and
run my query a second time, or a third time (I haven't made it past 3
times). Basically what happens is every time I do this, excel does
not close once I hit my back button. Does anyone have a solution to
this problem? Another problem is that when I run the query it just
opens excel within my browser, is there any way to make it ask if you
want to save or open the file? Thank You.

I basically throw this code at the top of the html doc:

<%
'Change HTML header to specify Excel's MIME content type
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
%>

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rich Wallace | last post by:
Hello all, Looking for suggestions and tips if possible. I have an application running on a file server that utilizes the FileSystemWatcher to trap when any Excel files are saved by a user. I...
5
by: Mike in Santa Rosa | last post by:
I'm trying to get a simple c# app built that can launch/manipulate an excel workbook, sheet. I've chased down several examples and can't any of them to work. So I must be doing somethnig obviouslt...
0
by: manoharcr | last post by:
I am using the fallowing code.... This condition generats a two different excel sheet based on IF condition If(Condtion) { response.setContentType("application/vnd.ms-excel");...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
9
by: John Bailo | last post by:
I want to generate an Excel file (.xls format) from some database data. I don't want to use Excel.exe because of all the automation and security issues. Does Microsoft document the .xls file...
18
by: John Bailo | last post by:
I want to write an Excel file (.xls format) from some database data. I don't want to use Excel.exe because of all the automation and security issues. Does Microsoft document the .xls file...
4
by: Fred | last post by:
Is it possible to generate a chart using the excel 2007 engine for a web page? (output in jpg)... If not what 3rd party solution would you recommend for this purpose Thanks, Fred
6
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 Hi All, How can we generate an Excel File through C#.NET without using Interops or XML ? Any leads on this would...
7
Walt in Decatur
by: Walt in Decatur | last post by:
I'm trying to use this method to copy an range in Excel workbook that is closed to the one that's open. I'm using the following code, which gets the "Can't find installable ISAM" error when I get to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.