Solved

Export DataGridView to Excel

Posted on 2006-06-19
4
21,012 Views
Last Modified: 2011-08-18
Hi

I’m looking for the best way to Export a populated DataGridView to Excel?
It’s a windows forms application C#.Net 2005.

Thanks
0
Comment
Question by:deon001
4 Comments
 
LVL 10

Expert Comment

by:SystemExpert
ID: 16941676
Hi,

You can use SQL REPORTING SERVICES for export to excel,PDF ,..... and you can also  

or

private void ExportLinkButton_Click(object sender, System.EventArgs e)
{
  string strTitle = “put the grid title here”;
  new DataGridExcelExporter(this.YourGridName , this.Page).Export(strTitle);
}
where,

strTitle is the title of the DataGrid.
DataGridExcelExporter is the name of main class.
this.YourGridName is the DataGrid object.
this.Page is the current Page object.


or

 you can go for this link and find the solution

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

http://www.codersource.net/published/view/283/exporting_data_grid_to_excel.aspx

Thanks

0
 
LVL 2

Accepted Solution

by:
Anandavally_P earned 500 total points
ID: 16942882
Hi
try this site

http://www.codeproject.com/csharp/export.asp

Thanks
Anandavally P
0
 

Author Comment

by:deon001
ID: 16957794
Thanks for the help and quick response

Deon
0
 

Expert Comment

by:Thejus
ID: 21059592
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now