views:

325

answers:

2

if i define a table like this:

 Dim datatable As PdfPTable = New PdfPTable(4)

and i dont have 4 cells to add in it, how can i make it so that it automatically fills the cell if there are not enough cells?

i am finding that unless i have at least 4 cells in there, it wont display it

the question is how do i figure out which cells are blank?

+1  A: 

How about filling with empty Cells?

Edit
Something like:

yourPdfPTable.AddCell(yourEmptyPdfPCell)

Where yourEmptyPdfPCell is a cell with an empty string.

Jay Riggs
i remember there's a function that does this do u know?
I__
With the PdfPTable.AddCell(PdfPCell) method.
Jay Riggs
+2  A: 

Something like, figure out programmatically which cells are blank, and then for those cells:

iTextSharp.text.pdf.PdfPTable pt = new iTextSharp.text.pdf.PdfPTable(100);
iTextSharp.text.pdf.PdfPCell cBlank = new iTextSharp.text.pdf.PdfPCell(new Phrase(" "));
pt.AddCell(cBlank);
Steve
the question is how do i figure out which cells are blank?
I__
this is actually helpful but can u give me this in vb.net?
I__
I can't answer for the blanks - that's dependent on how you generate your document and I don't know how you're doing that. An online converter will do for the translation. Try something like http://www.developerfusion.com/tools/convert/csharp-to-vb/
Steve