Exporting to Excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Cooper

    Exporting to Excel

    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 programmaticall y and then link to it?

    Andrew Cooper
  • rowe_newsgroups

    #2
    Re: Exporting to Excel

    On Aug 26, 9:16 am, Andrew Cooper <kairoscreat... @gmail.comwrote :
    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 programmaticall y 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 ("applicatio n/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]

    Comment

    Working...