Forums Register Login

PdfPTable

+Pie Number of slices to send: Send
Bruno,

We are using iText and very happy with it. The one area that I have not come up with a good answer is for our table of addresses. We are using PdfPTables. The table is 2 columns wide by 3 rows high. Each cell also contains another PdfPTable. This is done so that the top of each pair of inner tables (of each row of the outer table) is at the same height on the page. Our problem is that we have to force a new page before beginning the outer table since we have quite a bit of address data, sometimes leaving alot of white space on the previous page. Is there a better way of doing this instead of the nested tables?

Thanks,
Chris
+Pie Number of slices to send: Send
 

Originally posted by Chris Lonie:
Is there a better way of doing this instead of the nested tables?



You have something like this:

+-------+-------+
| table | table |
+-------+-------+
| table | table |
+-------+-------+
| table | table |
+-------+-------+

Before adding this to the document,
you perform document.newPage().

I assume that you want to split the table.
Question is: (how) do you want to split the table?

Which part of the table do you want on the
current page, and which part should be forwarded.
Do you want to split the table keeping the rows
of the outer table complete (no splitting of the
inner tables), keeping the rows of inner tables
complete (no splitting of inner rows), or can
inner rows be cut in two?

I'll try to provide an example with the different
possibilities soon. There's an example in the book,
but it doesn't involve nested tables.

br,
Bruno
+Pie Number of slices to send: Send
Bruno,

Yes, the table does look the way you drew it and, yes, we do perform a document.newPage().

I would like to keep the rows of the inner table complete. If it is easier to allow the inner rows be cut in two, then that is also very acceptable.

Thanks,
Chris
+Pie Number of slices to send: Send
 

Originally posted by Chris Lonie:
I would like to keep the rows of the inner table complete. If it is easier to allow the inner rows be cut in two, then that is also very acceptable.



OK, I've been very busy today.
I'll try to find some time to write you some sample code tomorrow.
+Pie Number of slices to send: Send
Thank you - it is very much appreciated.
+Pie Number of slices to send: Send
This is an example demonstrating how nested tables are split:


[ UD: Broke long line into two, so that the layout doesn't get screwed up. ]
[ November 18, 2006: Message edited by: Ulf Dittmer ]
+Pie Number of slices to send: Send
 


UD: Broke long line into two, so that the layout doesn't get screwed up.



Thanks!
I'll put the next code sample (adding a submit button to an existing form) online somewhere, so that people don't have to copy/paste.
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1709 times.
Similar Threads
How to add curve to the pdftable in itext
Data fetch from multiple SQL tables
Create table rows dynamically after reading from pdf template
Download PDF
iText - problem in splitting tables across multiple pages
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:01:08.