views:

132

answers:

3

Hi,

My requirement is to generate pdf where data retrieved from the database should be splitted between pages if data is more rather than creating entire data in new page.

For instance sometimes when a table has to be splitted on another page, some cells of the splitted row should appear on the preceding page while the others appear on the next one.

PLease help on this.

A: 

Have you considered iReport?

Thierry-Dimitri Roy
I'm working with IText package through manual coding
Chandu
A: 

Maybe you should consider looking at Jasper Reports

Saher
Thierry-Dimitri Roy was faster in his response
Saher
I'm working with IText package through manual coding
Chandu
A: 

PdfPTable splits itself across pages. It's fairly easy to construct one of those.

The downside is that it can be a pain to style the table to your specific needs. You may need to write some abstractions for it.

Once you have your document, adding tables/cells is as easy as:

Document document = // some document
PdfPTable table = new PdfPTable(columns);
table.addCell(new PdfPCell("data goes here));
Jes