This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested
any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on
the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
Sincerely,
Benson Yu
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
My friend introduces me one article which shows how to use a small tool to export data to PDF and other format files and displays the code source. I think that the article is helpful for you!
None
0 Points
31 Posts
how to export datagrid data to pdf in asp.net wtih c#
Jun 25, 2007 05:19 AM|i_balagopal|LINK
hi ,
Any One Can help me how to export datagrid data to pdf not excel (purely pdf) using asp.net with c#
regards
siddhu
Member
240 Points
125 Posts
Re: how to export datagrid data to pdf in asp.net wtih c#
Jun 25, 2007 09:48 AM|Shobana P.S|LINK
use this code
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", strReportName);
Response.AppendHeader("content-length", Result.Length.ToString()) ;
Response.BinaryWrite(Result);
Response.Flush();
Response.Close();
thsi will render the data in the grid(result) to pdf
Shobana
All-Star
30432 Points
2481 Posts
Re: how to export datagrid data to pdf in asp.net wtih c#
Jun 27, 2007 02:55 AM|Benson Yu - MSFT|LINK
Hi siddhu,
Based on my research, I find the following two links. I hope it is helpful to you.
DataGridExporter - Exports an ASP.Net 1.1 DataGrid to PDF using iTextSharp
http://www.ronosaurus.com/opensource/datagridexporter/
iTextSharp
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.http://sourceforge.net/projects/itextsharp/
Benson Yu
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
None
0 Points
31 Posts
Re: how to export datagrid data to pdf in asp.net wtih c#
Aug 24, 2007 06:36 AM|i_balagopal|LINK
hi want
with out using third party components. only code
None
0 Points
1 Post
Re: how to export datagrid data to pdf in asp.net wtih c#
Nov 26, 2007 04:58 AM|Jasmin_mca2001|LINK
Hi You can try this code.
protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
//Response.ContentType = "application/pdf";
Response.ContentType = "application/vnd.ms-excel";
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
//this.RenderControl(htmlTextWriter); this is for whole page.
grdTest.RenderControl(htmlTextWriter);
Response.Write(stringWriter.ToString());
Response.End();
}
Regards,
Jasmin Malviya
Member
20 Points
12 Posts
Re: how to export datagrid data to pdf in asp.net wtih c#
Mar 09, 2011 10:47 PM|TracyLandy|LINK
My friend introduces me one article which shows how to use a small tool to export data to PDF and other format files and displays the code source. I think that the article is helpful for you!
You can read the article on http://www.codeproject.com/KB/cs/Excel_PDF_Word_ExportWiz.aspx