Aligning a cell to the right depending on the alignment of its header with iTextSharp

0

I am creating a pdf from a gridview using the PdfPTable and PdfPCell classes of iTextSharp 5.5.11 and I have several columns such as Cost and Price among others, but in the case of these two I would like to show me their content aligned to the right.

    If gridViewHeaderCell.Text = "Cost" Or gridViewHeaderCell.Text = "Price" 
        Or gridViewHeaderCell.Text = "Profit" Or gridViewHeaderCell.Text = 
        "Total Cost" Or gridViewHeaderCell.Text = "Total Billed" Or 
        gridViewHeaderCell.Text = "Total Profit" Then     
            pdfCell.HorizontalAlignment = PdfPCell.ALIGN_RIGHT               
    End If

I get this code for the headers but I need to do it for the cells in each of these columns too.

Does anyone know any form of before adding the cell to know which heading (column) it belongs to?

    
asked by Eagle 05.04.2017 в 18:25
source

0 answers