Esempio n. 1
0
 // adiciona uma célula com o texto organizado em várias linhas diferentes
 protected void AddNewCell(iTextSharp.text.Table table, List<string> paragraphs, iTextSharp.text.Font font)
 {
     Cell cell = new Cell();
     foreach (string paragraph in paragraphs)
     {
         iTextSharp.text.Chunk chunk = new iTextSharp.text.Chunk(ConvertNewLines(paragraph), font);
         Paragraph p = new Paragraph(10, chunk);
         cell.Add(p);
     }
     cell.VerticalAlignment = Element.ALIGN_TOP;
     cell.HorizontalAlignment = Element.ALIGN_LEFT;
     table.AddCell(cell);
 }
Esempio n. 2
0
        // adiciona uma célula à tabela onde cada porção de texto tem uma formatação própria
        protected void AddNewCell(iTextSharp.text.Table table, List<Chunk> chunks)
        {
            Phrase f = new Phrase();
            f.Leading = 10;
            foreach (Chunk c in chunks)
                f.Add(new iTextSharp.text.Chunk(ConvertNewLines(c.Text), c.Font));

            Cell cell = new Cell(f);
            cell.VerticalAlignment = Element.ALIGN_TOP;
            cell.HorizontalAlignment = Element.ALIGN_LEFT;
            table.AddCell(cell);
        }
Esempio n. 3
0
 protected void AddNewCell(iTextSharp.text.Table table, string text, iTextSharp.text.Font font, int hAlignment)
 {
     Cell cell;
     if (font == null)
         cell = new Cell(new Phrase(ConvertNewLines(text)));
     else
         cell = new Cell(new Phrase(ConvertNewLines(text), font));
     
     cell.VerticalAlignment = Element.ALIGN_MIDDLE;
     cell.HorizontalAlignment = hAlignment;
     table.AddCell(cell);
 }
Esempio n. 4
0
 protected void AddNewCell(iTextSharp.text.Table table, iTextSharp.text.Cell cell)
 {
     table.AddCell(cell);
 }
Esempio n. 5
0
    protected static void SetContactInfo(Misc.sp_052_displayConfirmationRow row, iTextSharp.text.Table tblMain)
    {
        Phrase ph = new Phrase();
        ph.Add(GetTextPhrase("--- Header Information ---\n", true, 14));
        ph.Add(GetTextPhrase("Confirmation Number:", true));
        ph.Add(GetTextPhrase(row.ConfirmationID+ "\n" , false));
        ph.Add(GetTextPhrase("UtilityName:", true));
        ph.Add(GetTextPhrase(row.UtilityName + "\n", false));
        tblMain.AddCell(ph);

        ph = new Phrase();
        ph.Add(GetTextPhrase("--- Rebate Summary ---\n", true, 14));
        ph.Add(GetTextPhrase("IncentiveName: ", true));
        ph.Add(GetTextPhrase(row.IncentiveName + "\n", false));
        ph.Add(GetTextPhrase("Summary: ", true));
        ph.Add(GetTextPhrase(row.Summary + "\n" , false));
        tblMain.AddCell(ph);

        ph = new Phrase();
        ph.Add(GetTextPhrase("--- Item Purchased ---\n", true, 14));
        ph.Add(GetTextPhrase("CategoryLabel:", true));
        ph.Add(GetTextPhrase(row.CategoryLabel + "\n", false));
        ph.Add(GetTextPhrase("BrandName: ", true));
        ph.Add(GetTextPhrase(row.BrandName + "\n" , false));
        ph.Add(GetTextPhrase("RatingModelNumber: ", true));
        ph.Add(GetTextPhrase(row.RatingModelNumber + "\n", false));
        tblMain.AddCell(ph);

        ph = new Phrase();
        ph.Add(GetTextPhrase("--- My Information ---\n", true, 14));
        ph.Add(GetTextPhrase("First Name:", true));
        ph.Add(GetTextPhrase(row.FName + "\n" , false));
        ph.Add(GetTextPhrase("Last Name: ", true));
        ph.Add(GetTextPhrase(row.LName + "\n", false));
        ph.Add(GetTextPhrase("Street: ", true));
        ph.Add(GetTextPhrase(row.Street + "\n" , false));
        ph.Add(GetTextPhrase("Apartment: ", true));
        ph.Add(GetTextPhrase(row.Apartment + "\n", false));
        ph.Add(GetTextPhrase("City: ", true));
        ph.Add(GetTextPhrase(row.City + "\n" , false));
        ph.Add(GetTextPhrase("State: ", true));
        ph.Add(GetTextPhrase(row.State + "\n", false));
        ph.Add(GetTextPhrase("Zip: ", true));
        ph.Add(GetTextPhrase(row.ZIP + "\n" , false));
        ph.Add(GetTextPhrase("Logon Email: ", true));
        ph.Add(GetTextPhrase(row.logonEmail + "\n", false));
        ph.Add(GetTextPhrase("UtilityAccountNumber: \n", true));
        ph.Add(GetTextPhrase(row.UtilityAccountNumber + "\n" , false));
        tblMain.AddCell(ph);

        //Utility Bill Payer, if other than me
        ph = new Phrase();
        ph.Add(GetTextPhrase("--- Utility Bill Payer --- \n", true,14));
        ph.Add(GetTextPhrase(row.B_FName + "\n", false));
        ph.Add(GetTextPhrase(row.B_LName + "\n", false));
        ph.Add(GetTextPhrase(row.B_Street + "\n", false));
        ph.Add(GetTextPhrase(row.B_Apartment + "\n", false));
        ph.Add(GetTextPhrase(row.B_City + "\n", false));
        ph.Add(GetTextPhrase(row.B_ZIP + "\n", false));
        ph.Add(GetTextPhrase(row.B_Phone + "\n", false));
        ph.Add(GetTextPhrase(row.B_email + "\n", false));
        tblMain.AddCell(ph);

        ph = new Phrase();
        ph.Add(GetTextPhrase("--- Mail Rebate To --- \n", true, 14));
        ph.Add(GetTextPhrase(row.ContactFName + "\n", false));
        ph.Add(GetTextPhrase(row.ContactLName + "\n", false));
        ph.Add(GetTextPhrase(row.ContactDept + "\n", false));
        ph.Add(GetTextPhrase(row.ContactStreet + "\n", false));
        ph.Add(GetTextPhrase(row.ContactCity + "\n", false));
        ph.Add(GetTextPhrase(row.ContactState + "\n", false));
        ph.Add(GetTextPhrase(row.ContactZip + "\n", false));
        ph.Add(GetTextPhrase(row.ContactPhone + "\n", false));
        ph.Add(GetTextPhrase(row.ContactWebsite + "\n", false));
        tblMain.AddCell(ph);
    }
Esempio n. 6
0
 protected static void SetTitle(Misc.sp_052_displayConfirmationRow row, iTextSharp.text.Table tblMain)
 {
     Cell CellTitle = new Cell();
     CellTitle.Colspan = 2;
     CellTitle.Add(GetTitlePhrase("Rebate Form (Confirmation ID " + row.ConfirmationID + ") \n\n"));
     CellTitle.HorizontalAlignment = Element.ALIGN_CENTER;
     tblMain.AddCell(CellTitle);
 }