I\'m trying to export a gridview to pdf with package iTextSharp.
I\'m doing it in my .aspx files :
Add the Rendering
Function after your PDF code
public override void VerifyRenderingInServerForm(Control control)
{
// verifies the control is rendered here
}
Add below code to avoid runat="server" error.
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
You may want to disable paging so that it exports all rows of Gridview to PDF.
Add below code before gridview's rendercontrol method.
gvReportingStockComp.AllowPaging = false;
gvReportingStockComp.DataBind();
Incase you've any doubt, refer below article.
http://www.aspsnippets.com/Articles/Export-GridView-To-Word-Excel-PDF-CSV-Formats-in-ASP.Net.aspx