Ok, I'm adding the rows using the following code:

        public void DrawBlock(ITextColumns block)
        {
            var table = new PdfPTable(block.Widths);
            table.WidthPercentage = 100f;
            table.DefaultCell.Border = Rectangle.NO_BORDER;

            AddRows(table, block.Spans1, block.Rows1, block.Fonts);
            AddRows(table, block.Spans2, block.Rows2, block.Fonts);

            _document.Add(table);
        }

        private void AddRows(PdfPTable table, int[] spans, List<string[]>
rows, FaxFonts[] fonts)
        {
            foreach (var row in rows)
            {
                var j = 0;
                for (var i = 0; i < spans.Length; i++)
                    if (spans[i] > 0)
                    {
                        table.AddCell(NewCell(row[j], fonts[i], spans[i]));
                        j++;
                    }
            }
        }

        private PdfPCell NewCell(string text, FaxFonts font, int colspan)
        {
            return new PdfPCell(new Phrase(text, _fonts[(int)font].Font)) {
Colspan = colspan };
        }

In AddRows spans look like { 1, 1, 1, 1, 1, 1 } or { 4, 0, 0, 0, 1, 1 }
Each row like { "col1", "col2", "col3", "col4", "col5", "col6" } or {
"col1", "col2", "col3", "col4" } for the above spans.

IIRC i was using table.AddCell(row[i]) when it didn't show the borders
earlier.

On Wed, Jun 29, 2011 at 10:47, 1T3XT BVBA <[email protected]> wrote:

> On 29/06/2011 9:24, hhn000 wrote:
> >
> > Does anyone have any idea of what I'm doing wrong?
> We don't have sufficient information to answer that question.
> 1. You say that you initially turned borders off and it worked.
> 2. Then you turned them on and it worked.
> 3. Now you turned them back off and it no longer works.
> We don't know what else you changed in 2.
> Maybe you've started working with PdfPCell objects instead of just the
> addCell() method.
> Only you know, so we don't have the answer: you have.
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to