Reputation:
In all the tutorials about tables I have found code like this:
PdfTable table = new PdfTable(5);
But in my case "PdfTable has no constructor". So any single tutorial, works for me.
Has any one solved this issue? I know it is quite common. Thanks for help!
Upvotes: 0
Views: 369
Reputation: 77528
The class you need is PdfPTable
, not PdfTable
(mind the extra P). Please let me know if you have found a tutorial where it says:
PdfTable table = new PdfTable(5);
I will personally contact the author trying to convince him to stop publishing non sense ;-)
PdfTable
used to be a class in a very old version of iTextSharp (a version that should no longer be used). It was an internal helper class for the no longer existing Table
class. You were not supposed to instantiate it (hence the message "PdfTable has no constructor").
For examples on using the PdfPTable
class, see http://tinyurl.com/itextsharpIIA2C04
Upvotes: 2