Exporting datagrid contents to Excel using ASP.NET

G

Guest

Hello,

I am attempting to export the contents of a datagrid on my webform (using
Excel automation) through ASP.NET.

I have added the Excel object library to my VS ASP.NET project but I am lost
on how to export my datagrid contents to Excel?

I am sure it can be done but having difficulties figuring out the code.

Any help would be greatly appreciated.

Thanks,

Mike
 
M

Michael Nemtsev

Hello Mike,

See sample there

http://gridviewguy.com/ArticleDetails.aspx?articleID=26

M> I am attempting to export the contents of a datagrid on my webform
M> (using Excel automation) through ASP.NET.
M>
M> I have added the Excel object library to my VS ASP.NET project but I
M> am lost on how to export my datagrid contents to Excel?
M>
M> I am sure it can be done but having difficulties figuring out the
M> code.
M>
M> Any help would be greatly appreciated.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Hi Michael,

Thanks for the tip. One more hurdle to cross though!

I am using VS 2003 and have added the System.IO import into my project
imports but Intellisense is still purple squiggly lining:

System.IO.StringWriter and System.Web.UI.HtmlTextWriter

I cannot locate the System.IO reference when I try to add to add it. Is
there something I am missing?

Please let me know.

Thanks,

Mike
 
M

Michael Nemtsev

Hello Mike,

Check that u add using System.IO and using System.Web.UI to you project
if this doesn't help try to reload project and studio, smth wrong with it
These classes are in vs2003, see msdn for example

M> Hi Michael,
M>
M> Thanks for the tip. One more hurdle to cross though!
M>
M> I am using VS 2003 and have added the System.IO import into my
M> project imports but Intellisense is still purple squiggly lining:
M>
M> System.IO.StringWriter and System.Web.UI.HtmlTextWriter
M>
M> I cannot locate the System.IO reference when I try to add to add it.
M> Is there something I am missing?
M>
M> Please let me know.
M>
M> Thanks,
M>
M> Mike
M>
M> "Michael Nemtsev" wrote:
M>---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

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