tags:

views:

90

answers:

1

Guys, this should be simple but pulling my hair out.Tried all variations and some places online say I should use cell events instead. I just want to switch off the black border. Can anyone help, seen this before? Many thanks in advance.

        //Paragraph paymentLinePara;
        //paymentLinePara = new Paragraph("\n"); UAT removed, js
        //document.Add(paymentLinePara);

        Table paymentLineTable = new Table(1);
        paymentLineTable.SetAlignment("LEFT");
        //build up headers
        //Cell lineHeader = new Cell(new Phrase("xxx", font_small));
        //lineHeader.Header = true;
        //lineHeader.SetHorizontalAlignment("LEFT");
        //lineHeader.SetVerticalAlignment("CENTER");
        //lineHeader.BackgroundColor = new Color(0xC0, 0xC0, 0xC0);
        //paymentLineTable.AddCell(lineHeader);

        //add detail rows
        foreach (var item in paymentItem.PaymentItemLines)
        {
            paymentLineTable.DefaultCell.BackgroundColor = Color.WHITE;
            if (item.Display)
                paymentLineTable.AddCell(new Phrase(item.Line, font_small));


        }

        paymentLineTable.Padding = 1;
        paymentLineTable.DefaultCellBorderColor = Color.WHITE;
        paymentLineTable.DefaultCellBorder = -1;
        paymentLineTable.DefaultCellBorderWidth = 0;

        paymentLineTable.Border = Rectangle.NO_BORDER;

        document.Add(paymentLineTable);
+1  A: 

This is iTextSharp, right? Try creating an actual Cell object:

Cell cell;

foreach (var item in paymentItem.PaymentItemLines)
{
    cell = new Cell(new Phrase(item.Line, font_small));
    cell.Border = 0;

    if (item.Display)
        paymentLineTable.AddCell(cell);
}

Comment out that default cell stuff temporarily.

Ryan B