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

Can SQLServer produce Excel Spreadsheet output ?

Deaa group,

I am using SQLServer 2000 in an XP Sp2. I would like to do the
following:

I have a program running on a database server that generates some data
which are loaded to the database. This program is used in a web
application, invoked by some java program and JSP scripts. (I am
frontend illiterated.)

The question is, is it possible to write a stored procedure to generate
output in excel spreadsheet? So that user could call this procedure
and get spreadsheet output on the client side.

Any pointer to a solution would be immensely apprecaited.

thanks,
charia

Jul 23 '05 #1
2 2282

<cp******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Deaa group,

I am using SQLServer 2000 in an XP Sp2. I would like to do the
following:

I have a program running on a database server that generates some data
which are loaded to the database. This program is used in a web
application, invoked by some java program and JSP scripts. (I am
frontend illiterated.)

The question is, is it possible to write a stored procedure to generate
output in excel spreadsheet? So that user could call this procedure
and get spreadsheet output on the client side.

Any pointer to a solution would be immensely apprecaited.

thanks,
charia


As far as I know, there's no direct way to export to an .xls from a stored
proc. DTS can export data to Excel, and you can execute a package from a
stored proc in various ways:

http://www.sqldts.com/default.aspx?210

By using ActiveX steps in a DTS package, you could control all the details
of the .xls file name, structure, column headers etc. via the Excel COM
interface, but you would need to actually install Excel on the server in
order to do that, which may not be possible (or desirable).

Another option would be calling bcp.exe via xp_cmdshell to create a CSV or
tab-delimited file. In the end, the easiest solution might be to find a Java
or JSP module of some sort which can export to Excel - then you just return
the result set to the client or middle tier as usual, and let it create the
file, which is probably a cleaner solution than dealing with presentation in
the database itself.

Simon
Jul 23 '05 #2
i know ASP can generate an xls from data selected by a SP. i bet there
is some way JSP can do it as well, i'm just not a web developer =P

Jul 23 '05 #3

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

Similar topics

5
by: Axial | last post by:
Question: How to select columns from Excel-generated XML when some cells are empty. I've found examples where rows are to be selected, but I can't seem to extrapolate from that to selecting...
1
by: Jim, N2VX | last post by:
I'd like to create/display an Excel spreadsheet from javascript. We have an HTML page with results of a search and it can be reasonably large. The first attempt was to format the data into an...
13
by: middletree | last post by:
Curt and McKirahan have been very helpful the past week as I have been introduced to something new to me: generating a spreadsheet from ASP. Now that I have the spreadsheet, I am in need of...
4
by: Gary Wright | last post by:
I have an Access 2K database split into front and back. Quite often the users want to do some data analysis that I have not created a report for so they want to export some subset of the data into...
2
by: Tony Williams | last post by:
Is it possible to import a spreadsheet from Excel where the rows contain the field names rather than the columns? I'm creating an Excel spreadsheet but there are over 50 items to import and would...
6
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet....
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
5
by: Sport Girl | last post by:
Hi everybody. I am new in PERL language and working in it since little hours, actually i am still a trainee and i need help please. In fact, i need a script in PERL that enables me to retrieve...
1
by: Sport Girl | last post by:
Hi everybody , i have the task of developing in Perl a script that retrieves data from 3 tables ( bugs, profiles, products) from a MySQL database called bugs and display them in an excel sheet...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.