Alex Gordon
Alex Gordon

Reputation: 60751

Getting position of pdfptable

in my document I am creating 3-4 pdfptables.

At design time I don't know the size of the tables. I need to place the 2nd table right after the first, but I dont know the position of the first (I can't calculate it because I dont know how big it is). How do I know where to place the second table?

Upvotes: 0

Views: 3050

Answers (2)

Sanjay Zalke
Sanjay Zalke

Reputation: 1371

That's right the table height and width is dynamically calculated, but you don't have to call WriteSelectedRows() function. You have to set either height or width.

In my case I had to first calculate that if font used can fill the page if not I had to dynamically change the font appropriately. So I find (by mistake) if you set TotalWidth the TotalHeight is automatically set/calculated.

Sanjay

Upvotes: 0

Jason
Jason

Reputation: 52523

You can figure out the total height of the table dynamically. After you use the WriteSelectedRows() function, you can call the .TotalHeight() property to find out how tall your table was (in points). Then figure out with some calculations where it ends and where the next one should begin.

Upvotes: 2

Related Questions