Posts

Showing posts from February, 2019

Bind Grid View using Session in ASP.Net

Image
HTML  The following HTML Markup consists of an ASP.Net GridView along with some TextBoxes and a Button in order to insert data in GridView control. < asp : GridView   ID ="GridView1"   runat ="server"   CssClass ="Grid"   AutoGenerateColumns ="false"      EmptyDataText ="No records has been added.">      < Columns >          < asp : BoundField   DataField ="Name"   HeaderText ="Name"   ItemStyle-Width ="120"   />          < asp : BoundField   DataField ="Country"   HeaderText ="Country"   ItemStyle-Width ="120"   />      </ Columns > </ asp : GridView > < br   /> < table   border ="0"   cellpadding ="0"   cellspacing ="0"   style =" border-collapse : collapse">      ...

Export HTML to PDF in Windows Forms Application using iTextSharp

Image
In this article I will explain with an example, how to export HTML to PDF in Windows Forms Application using iTextSharp, C# and VB.Net. First a DataGridView will be populated with some data and then an HTML Table will be generated using the values from the DataGridView. Finally, the HTML Table will be exported and saved as PDF file using  iTextSharp  and  XMLWorkerHelper  class in Windows Forms Application with C# and VB.Net. Form Design The Form Design consists of a DataGridView and a Button. Namespaces You will need to import the following namespaces. C# using  System.IO; using  System.Data; using  iTextSharp.text; using  iTextSharp.text.pdf; using  iTextSharp.tool.xml; Populating DataGridView Inside the Form Constructor, the DataGridView is populated with a dynamic DataTable populated with some dummy data. public  Form1() {     InitializeComponent();  ...