Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to Export Datagrid view data to excel in ASP.net 3.5?

Reply
Thread Tools

How to Export Datagrid view data to excel in ASP.net 3.5?

 
 
chandan
Guest
Posts: n/a
 
      10-14-2008
Hi All!
How to Export Datagrid view data to excel in ASP.net 3.5?

Thanks,
Chandan
 
Reply With Quote
 
 
 
 
Nafly
Guest
Posts: n/a
 
      10-16-2008
I have some code..
I think it will help you...
public static void CreateWorkbook(DataSet ds, String path)
{
XmlDataDocument xmlDataDoc = new XmlDataDocument(ds);
XslTransform xt = new XslTransform();
StreamReader reader =new StreamReader(typeof
(WorkbookEngine).Assembly.GetManifestResourceStrea m(typeof (WorkbookEngine),
"Excel.xsl"));
XmlTextReader xRdr = new XmlTextReader(reader);
xt.Load(xRdr, null, null);

StringWriter sw = new StringWriter();
xt.Transform(xmlDataDoc, null, sw, null);

StreamWriter myWriter = new StreamWriter (path + "\\Report.xls");
myWriter.Write (sw.ToString());
myWriter.Close ();
}

And also visit following websites

http://www.codeproject.com/KB/grid/e...agridview.aspx

http://www.c-sharpcorner.com/uploadf...idtoexcel.aspx

http://www.vbdotnetheaven.com/Upload...idtoExcel.aspx







"chandan" <> wrote in message
news:d58949e0-81a1-4229-a2a1-...
> Hi All!
> How to Export Datagrid view data to excel in ASP.net 3.5?
>
> Thanks,
> Chandan



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to Export Datagrid view data to excel in ASP.net 3.5? chandan ASP .Net 1 10-14-2008 08:17 PM
Display a Datagrid & Export a Datagrid to Excel Paul D. Fox ASP .Net Datagrid Control 1 07-21-2005 08:38 PM
Export to excel data from Datagrid rows sunilkumar Reddy via DotNetMonster.com ASP .Net 0 06-27-2005 12:05 PM
export datagrid data to Excel file Grey ASP .Net Datagrid Control 1 04-02-2004 11:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57