SIGN UP MEMBER LOGIN:    
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
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Become a Sponsor