Its seems that a PdfPTable with one row of cells will not print, but two
will. Is this an error on my part or something else?


        public static ByteArrayOutputStream build()
        throws Exception {
                
                
                Document document = new Document(PageSize.A4, 20, 20,
10, 30);
                 
                ByteArrayOutputStream baos = new
ByteArrayOutputStream();
                 
                PdfWriter.getInstance(document, baos);
                 
                document.open();
                 
                document.add(new Phrase("A PdfPTable with one row will
not print?"));
                
//               build the tables
                int NumColumns = 11;

                PdfPTable datatable = new PdfPTable(NumColumns);
                int headerwidths[] = { 10, 8, 8, 6, 6, 6, 6, 7, 7, 7, 5
}; // percentage
                datatable.setWidths(headerwidths);
                datatable.setWidthPercentage(90); // percentage
                datatable.getDefaultCell().setPadding(1);
                datatable.getDefaultCell().setBorderWidth(1);
                
datatable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);        
        
                datatable.setHeaderRows(1); // this is the end of the
table header
                
                datatable.addCell("Row 1");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                
        /*      
                datatable.addCell("Row 2");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
                datatable.addCell(" ");
        */      
                
                document.add(datatable);
                
                document.close();
                
                return baos;
                
        }


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to