Erik Pfingsten wrote: > I would like to simulate something like SQL Reporting services > where they will get repeating headers on each page, as well as having > long rows break across pages (ie when they select 50 fields and the data > is say 500 rows of data, the first 10 fields/first 30 rows show on page > 1, the next 10 fields/first 30 rows show on page 2, etc through page 5, > then the next set of rows 31-60 appears on page 6, etc.
That's done automatically, isn't it? See http://1t3xt.be/?X00002a > My general approach that I am thinking of taking is as follows: > Set up a table with the 50 columns > calculate approximate column widths by using getWidthPoint on the text > in each column of the first row of data You need to know the column widths in advance; so yes, you probably need getWidthPoint to achieve this. > use the columns widths to do SetTotalWidth > add my cells to the table > use PdfPTable.Size to get the number of rows in the table, then divide > that by how many rows I think will fit on a page I don't think that's necessary, unless you > use WriteSelectedRows(colStart, colEnd, rowStart, rowEnd, xPos, yPos, > canvas) to write out x number of columns and n number of rows then do a > new page and use WriteSelectedRows with the next batch of columns, do a > new page, next set of columns, etc. I don't understand why you would need WriteSelectedRows. Why don't you add the table to the document? If you need to add the table at absolute positions, wrap it in a ColumnText object like this: http://1t3xt.be/?X0000a4 > Does this makes sense? In general is this the "correct" way to go about > accomplishing what I need or am I going down a completely wrong path? I think you're making it yourself difficult by using writeSelectedRows. It's easier to just add the table to the document. That also allows you to tune the way the content inside the cells is split: http://1t3xt.be/?X000041 > Also, I have ordered the book and it should be arriving tomorrow, so if > the answer is “this exact situation is described in detail in the book, > go buy it”, I can live with that too You'll recognize the examples mentioned above in chapter 6 of the book ;-) -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
