I'm using iText (iTextSharp version 5.5.7) and I am creating a PdfPTable where the data in the rows is sorted. To give a specific example, say my data looks like this (including my headers - h1, h2, and h3):
+---+---+---+
|h1 |h2 |h3 |
+---+---+---+
| A | B | C |
+---+---+---+
| A | B | D |
+---+---+---+
| A | E | F |
+---+---+---+
| K | G | H |
+---+---+---+
| K | G | I |
+---+---+---+
| K | G | J |
+---+---+---+
I've got that working, and then I started setting the Rowspan property of PdfPCell so I can avoid printing repeated text. That's also working great, what I get is this:
+---+---+---+
|h1 |h2 |h3 |
+---+---+---+
| A | B | C |
| | +---+
| | | D |
| +---+---+
| | E | F |
+---+---+---+
| K | G | H |
| | +---+
| | | I |
| | +---+
| | | J |
+---+---+---+
The problem is, I hit page breaks, and what I see is this:
+---+---+---+
|h1 |h2 |h3 |
+---+---+---+
| A | B | C |
| | +---+
| | | D |
| +---+---+
| | E | F |
+---+---+---+
| K | G | H |
+---+---+---+
Page Break
+---+---+---+
|h1 |h2 |h3 |
+---+---+---+
| | | I |
| | +---+
| | | J |
+---+---+---+
What I want, is that when that second page starts, I want the spanned cells (in this case 'K' and 'G') to be re-printed so the user has some idea what's going on.
What I need is similar to a HeaderRow, but what I need the header row to be changes as the rows are emitted.
Any ideas on how to make this work?
A,KandGusing cell events instead of adding it as "real" content of the cell. - Bruno LowagiesetBorder(PdfPCell.NO_BORDER)). (2.) What makes you think you can't draw borders in a cell event? Did you read The Best iText Questions on StackOverflow. There's a reference to this question. - Bruno Lowagie