473,385 Members | 1,337 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,385 software developers and data experts.

Exporting as Excel (database results)

All,
I am trying to export a result set as an excel spread
sheet. Most of the time this works as expected, when a
user chooses to save as excel the browser pop-up a save as
dialog to allow the user to save the spreadshet with
a .xls name.

Some times the browser will open up the file as text file
within the bvrowser itself?

These are my two lines of code to prompt the save as
dialog for a Browser:
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-
disposition", "attachment;filename=ReportsName.xls"

I do not use any HTML to write out the Response from the
Database rather just plain text and VBTab for a new column
and VBCrLf for a new line.

Thanks
Jawahar

Jul 19 '05 #1
2 2490
If the user does not have Excel or if the user has "confirm open after
download" selected for the .xls filetype, he will get the download prompt.

Ray at work

"Jawahar Rajan" <jr****@nc.rr.com> wrote in message
news:23****************************@phx.gbl...
All,
I am trying to export a result set as an excel spread
sheet. Most of the time this works as expected, when a
user chooses to save as excel the browser pop-up a save as
dialog to allow the user to save the spreadshet with
a .xls name.

Some times the browser will open up the file as text file
within the bvrowser itself?

These are my two lines of code to prompt the save as
dialog for a Browser:
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-
disposition", "attachment;filename=ReportsName.xls"

I do not use any HTML to write out the Response from the
Database rather just plain text and VBTab for a new column
and VBCrLf for a new line.

Thanks
Jawahar

Jul 19 '05 #2
Would possibly removing the word attachment; help at all?
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

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

Similar topics

3
by: Jeremy | last post by:
Hi, I have a webpage that is taking input from a form and using it as criteria to select data out of an sql database. The page displays an html table with the results. The user can then click a...
3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
1
by: Suffrinmick | last post by:
Hello Everyone I've built a database using Access 2000 which includes a query which is built using a form containing filters. No problem. When I export the results of the query to excel, (File >...
21
by: bobh | last post by:
Hi All, In Access97 I have a table that's greater than 65k records and I'm looking for a VBA way to export the records to Excel. Anyone have vba code to export from access to excel and have the...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
12
by: TARHEELS721 | last post by:
I am trying to send the results of a query that runs when I click a button on my form that is based on a parameter query. The code runs without any errors but nothing is exported into my excel...
4
by: myemail.an | last post by:
Hi all, I use Access 2007 and have the following problems: when exporting banal select queries (either to Excel or to a csv file) I find that exporting often doesn't work and creates a file with...
7
by: alf8kitty | last post by:
Hello, Im still very new to php and am having a problem. I return a MySQL query to a form in my php page and I want to be able to export the form data to Excel when the users clicks a link (or a...
1
by: ndedhia1 | last post by:
hello, I am creating a comma delimited text file in php and need to export the results to an excel file. I am creating the text file thru querying a mySql database. Right now, we have the .txt...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.