Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Exporting a DataGrid to Excel

Options
  • 11-07-2005 3:22pm
    #1
    Registered Users Posts: 28


    Hey, I'm after writing a database app in C# (not my language of choice) and now I've been asked to export the datagrids to Excel, so they can be printed and such. There's some ASP code for exporting datagrids floating around on the net, but not much on ADO. Any one wanna offer any ideas/help/code etc?


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    What version of excel are you using? If it supports xml then the problem is easily solved. If not there are other ways of getting the data in there ;)


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    The writer doesn't say in this article but I'm fairly sure it's office xp/2003 only. Might help though.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I have code at home that opens an odbc connection to an excel file and allows you to drop a dataset into a named range. I'll look it up tonight.


  • Registered Users Posts: 604 ✭✭✭Kai


    Try this
    http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp

    I havent tried it myself but it may give you an idea.


Advertisement