ARTICLE

Exporting datagrid from to an Excel, Word and notepad format

Posted by dhaval khunt Articles | ASP.NET Controls in C# July 27, 2010
There are several solutions for this implementation and in this example we will convert the datagrid to excel, word and notpad format.
Reader Level:
Download Files:
 

Many times we would like to export our page as an Excel sheet, Word doc or PDF file. This can be simply achieved by changing the ContentType of the Response object and overriding the RenderControl method of the control to be exported

Export to Excel,word and notepad are one of the most common functionality required in ASP.Net pages.Users can download the data from the datagrid into an Excel spreadsheet for offline verification and/or computation. This article includes the source code  for such functionality.

How it works

This main functionality to Export a datagrid from an ASP.Net Web Form to an Excel,word and notepad format is actually very simple. There are several solutions for this implementation and in this example we will convert the datagrid to excel,word and notepad format. The RenderControl method available in the .Net Framework provides the server control content to an HtmlTextWriter which is subsequently written out to the Response Stream.

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter