Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Export DataGridView to Excel

Posted on 2006-06-19
4
21,022 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

791 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