Exporting to Excel

A

Andrew Cooper

I've got an ASP.NET page with a GridView connected to an Object Data
Source. The GridView is working fine but my users would like the
information to also be available in an Excel spreadsheet format. Is
there any way to export the data from either the Data Source or from the
Grid View into an Excel document programmatically and then link to it?

Andrew Cooper
 
R

rowe_newsgroups

I've got an ASP.NET page with a GridView connected to an Object Data
Source.  The GridView is working fine but my users would like the
information to also be available in an Excel spreadsheet format.  Is
there any way to export the data from either the Data Source or from the
Grid View into an Excel document programmatically and then link to it?

Andrew Cooper

Simplest thing, which occasionally works, is to set the page's
ContentType to the MIME type for Excel ("application/excel" or
something like that). This will force the page to be opened by Excel
and might do the job (or you might just get a scrambled mess!)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top