Hi,

I have a problem with the new feature "rowspan" (great feature!) in 
version 2.1.6. I have a small table with two rows and three columns. The 
first cell in the table has a rowspan of 2. The text inside this cell has 
3 lines. The other cells are filled with single line text. If I create the 
PDF file, the first table cell (with rowspan) contains the first two lines 
only. The third line is missing.

The problem seems to be that the cell is not adjusted in height. Is this a 
limitaion of the the new rowspan feature or a problem? A small sample you 
can find below.

Regards
Bernd

try {
      Document document = new Document(PageSize.A4, 50, 50, 150, 72);
      PdfWriter writer = PdfWriter.getInstance(document, new 
FileOutputStream(basePath + "table_span.pdf"));

      document.open();

      PdfPCell cell = null;

      PdfPTable mainTable = new PdfPTable(3);

      cell = new PdfPCell();
      cell.addElement(new Phrase("This is the first line"));
      cell.addElement(new Phrase("This is the second line"));
      cell.addElement(new Phrase("This is the third line"));
      cell.setRowspan(2);
      mainTable.addCell(cell);

      cell = new PdfPCell();
      cell.addElement(new Phrase("1a"));
      mainTable.addCell(cell);

      cell = new PdfPCell();
      cell.addElement(new Phrase("2a"));
      mainTable.addCell(cell);

      cell = new PdfPCell();
      cell.addElement(new Phrase("1b"));
      mainTable.addCell(cell);

      cell = new PdfPCell();
      cell.addElement(new Phrase("2b"));
      mainTable.addCell(cell);

      document.add(mainTable);

      document.close();

    } catch (Exception e) {
      e.printStackTrace();
    }
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
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
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to