2

I want to know why Type 'iTextSharp.text.Table' is not defined. I already imported iTextSharp.text , iTextSharp.text.pdf, iTextSharp.text.html, iTextSharp.text.html.simpleparser.

Dim gvTable As New iTextSharp.text.Table(columns, tableRows)

Sherlene Tan
  • 77
  • 1
  • 2
  • 8

1 Answers1

1

In searching the Internet the only thing I could find about iTextSharp.Text.Table was example code. I looked at the SVN on SourceForge and there is no Table that is part of the text namespace, it looks like it was deprecated in the current version. Your best bet would be to use iTextSharp.text.pdf.PDFPTable. (Documentation from iText link) or to find a Version of iTextSharp previous to version 5. If you look at this SO Question/Answer there is a link to iTextSharp version 4.1.6 this version does have iTextSharp.text.Table. Here also is a blog that has links to the Source and dll.

Community
  • 1
  • 1
Mark Hall
  • 53,938
  • 9
  • 94
  • 111
  • If I don't use the iTextSharp, what else can I use to save my page to PDF format. (including saving gridview) – Sherlene Tan Jul 20 '12 at 03:38
  • @SherleneTan Did you try the links to the older version of iTextSharp that I linked to, that version does have the Method you are looking for. I am not sure of what the capabilities of the other librarys are so I can not really recommend one. – Mark Hall Jul 20 '12 at 03:51
  • Thank you! I have fixed the problem. However, my gridview is using databind instead of boundfield. Is there any other way of importing the gridview into PDF? I use the code from this website: (http://www.aspsnippets.com/Articles/Export-ASP.Net-GridView-to-PDF-with-Custom-Columns-Widths-using-iTextSharp.aspx) – Sherlene Tan Jul 20 '12 at 04:20
  • @SherleneTan To be honest with you I am not that familiar with Asp.Net, I develop primarily in Wpf and Winforms . – Mark Hall Jul 20 '12 at 05:17