In this article we will know how to export gridview data to pdf format. For that we need itextsharp.dll file. Get it from
Table structure

First add the itextsharp.dll file into the application as click solution explorer- Right click on your application file-Add reference-On browse tab search the itextsharp.dll file from your computer-Click ok-Finish. Then you will notice that a Bin folder will be created where you will find itextsharp.dll file present inside that folder.
- <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- </div>
- <asp:GridView ID="GridView1" runat="server" BackColor="#FFFF99"
- Font-Bold="True" ForeColor="Red">
- <HeaderStyle BackColor="#66FFFF" Font-Bold="True" ForeColor="#CC3300" />
- <AlternatingRowStyle BackColor="#FFCC99" />
- </asp:GridView>
- <asp:Button ID="Button1" runat="server" Text="Export to Pdf" />
- </form>
- </body>
- </html>


Comments
Join the conversation! Your thoughts help the community grow.