You just need to replace the GridView with your HtmlTable control. However, as the article says, you don't have much control over the formatting. My advice is to create your table in iTextSharp directly and write the rows of data to it. I have an example
in one of my iTextsharp articles here: http://www.mikesdotnetting.com/article/86/itextsharp-introducing-tables
We have seen on a number of occasions how a cell can stretch horizontally through the use of the Colspan property. But what about vertically? In HTML you would use the Rowspan property, but there is no equivalent
in iTextSharp. So the answer is nested tables.
iTextSharppdfasp.net
I'm afraid I no longer use this forum due to the new point allocation system.
Member
18 Points
102 Posts
asp.net create pdf
Mar 03, 2015 02:32 AM|satheeshsara|LINK
hi,
I am search the net for create a pdf i found iTextSharp .dll.
Using PdfPTable we can create a table in pdf.
but my problem is i have table in (Web.UI.HtmlControls.HtmlTable)
Any way to convert HtmlTable to PdfPTable.
thank you,
iTextSharp pdf asp.net
All-Star
190373 Points
27640 Posts
Moderator
Re: asp.net create pdf
Mar 03, 2015 02:40 AM|Mikesdotnetting|LINK
Here's an article that shows how to export a GridView to PDF using iTextSharp: http://highoncoding.com/Articles/483_Exporting_GridView_to_PDF_Document.aspx
You just need to replace the GridView with your HtmlTable control. However, as the article says, you don't have much control over the formatting. My advice is to create your table in iTextSharp directly and write the rows of data to it. I have an example in one of my iTextsharp articles here: http://www.mikesdotnetting.com/article/86/itextsharp-introducing-tables
iTextSharp pdf asp.net
Member
18 Points
102 Posts
Re: asp.net create pdf
Mar 03, 2015 03:59 AM|satheeshsara|LINK
thank you
Mikesdotnett...
iTextSharp pdf asp.net
Member
18 Points
102 Posts
Re: asp.net create pdf
Mar 03, 2015 04:06 AM|satheeshsara|LINK
Mikesdotnett... i have a another question.
It's possible to create nested tables in pdfptable
iTextSharp pdf asp.net
All-Star
190373 Points
27640 Posts
Moderator
Re: asp.net create pdf
Mar 03, 2015 04:12 AM|Mikesdotnetting|LINK
Yes - my article covers that.
iTextSharp pdf asp.net
Member
18 Points
102 Posts
Re: asp.net create pdf
Mar 03, 2015 04:26 AM|satheeshsara|LINK
Sorry i can't find it. can you give me that code
iTextSharp pdf asp.net
All-Star
37441 Points
9076 Posts
Re: asp.net create pdf
Mar 03, 2015 04:36 AM|AidyF|LINK
Ctrl+F then search for "nested"
iTextSharp pdf asp.net
Member
18 Points
102 Posts
Re: asp.net create pdf
Mar 03, 2015 05:09 AM|satheeshsara|LINK
Thank you
iTextSharp pdf asp.net