Hello,
 
I'm having a probem to draw table borders with a tableevent refering to
the
http://itext.ugent.be/library/com/lowagie/examples/objects/tables/pdfpta
ble/TableEvents1.java example.
 
The primary goal is to draw a border around the tableheader cells.
 
The following scenario do I have:
I create a PdfPTable and add PdfPCells with my data to the table.
After adding the cells I set the header rows and the event.
 
I guess it's useless to set the header rows while unsing
writeSelectedRows()?
 
pdfTable.setHeaderRows(headerRows); 
pdfTable.setTableEvent(tEvent);
 
After that, I write the cells to the document:
pdfTable.writeSelectedRows(cntRows, i + 1, xPos,currentY, cb);
 
As I know the current position in my document, I'll add new pages, if
the table is too large for the site. So I add the tableheader and the
rest of the tabledata to a new page.
 
In my tableevent (an extension of PdfPTableEventForwarder) I use the
overwritten method:
public void tableLayout(PdfPTable table, float[][] widths, float[]
heights,int headerRows, int rowStart, PdfContentByte[] canvases) {

...

}

The variable "headerRows" has the value 0 on every call. I guess
writeSelectedRows() do not use it.
The second thing is, that if a table contains more data as for one page,
the event do not recognize the new page, because I add the header on the
new page with writeSelectedRows() too.
 
 
So my question is: Which is the best way to draw borders (on
tableheaders) on a table with a tableevent and writeSelectedRows()?
 
Kind regards,
Leif <mailto:itext-questions@lists.sourceforge.net> 
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to