[dba-SQLServer] Exporting to Excel when Excel is not installed

Eric Barro ebarro at roadrunner.com
Fri Sep 3 03:02:46 CDT 2010


Mark,

I would grab the data from sql and write it out to a file with a CSV or even
XLS extension. Excel will be perfectly happy to open that file.

If you want to write code you can use the response.contentype to specify an
Excel output.

HttpContext.Current.Response.ContentType = "Application/x-msexcel"

Eric

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark Breen
Sent: Friday, September 03, 2010 12:52 AM
To: Discussion of Hardware and Software issues; Discussion concerning MS SQL
Server
Subject: [dba-SQLServer] Exporting to Excel when Excel is not installed

Hello All,

I have a server running a DotNetNuke application.

I want to export data to Excel format from a sql source.  I can write a DLL
to do that, but I suspect that if Excel is not installed on the box, it will
not work.  Is that so?

If I uploaded some of my Excel DLL's would it work then?

The db is SQL Express so I suspect I cannot use SSIS - which is a pity.

It is running in a shared hosting environment and I have what I think is
named "Medium Trust" privillages.  AFAIK, this means that I would not be
able to run an Exe on the box.

I can schedule a DLL to be executed however through the in built scheduling
too.

any thoughts on how to achieve this?

Currently I am learning towards writing to a text file and naming is
data.xls  which will trick excel into opening a text tab delimited file.

Any better ideas?

Thanks

Mark
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list