示例#1
0
        private PdfPTable Parte13()
        {
            Tabela table = new Tabela(1);
            Celula cell;

            cell = new Celula(Frase("DATA: ", DateTime.Now.ToString("dd/MM/yyyyy"), 10));
            table.AddCell(cell);
            cell = new Celula(Frase("FILIAL: ", Globais.sFilial, 10));
            table.AddCell(cell);
            return(table);
        }
示例#2
0
        private PdfPTable Parte11()
        {
            Tabela   table = new Tabela(1);
            PdfPCell cell;
            Chunk    chunk;
            string   logo = "imagens\\logo_rel.jpg";
            Image    img;
            float    largura = 80F;
            float    altura  = 100F;

            try
            {
                img = Image.GetInstance(logo);
                float w = img.Width;
                float h = img.Height;
                while ((w > largura) || (h > altura))
                {
                    w *= 0.9F;
                    h *= 0.9F;
                }
                img.ScaleAbsolute(w, h);
                chunk = new Chunk(img, 0, 0);
            }
            catch
            {
                chunk = new Chunk("");
            }
            cell             = new PdfPCell(new Phrase(chunk));
            cell.BorderWidth = 0;
            table.AddCell(cell);
            return(table);
        }
示例#3
0
        public void AdicionaCelula(Tabela tabela, string texto, string BaseFont_, int tamanho, iTextSharp.text.Color cor, int colunas)
        {
            Chunk    chunk = new Chunk(texto, FontFactory.GetFont(BaseFont_, tamanho));
            PdfPCell cell  = new PdfPCell(new Paragraph(chunk));

            cell.BackgroundColor = cor;
            cell.Colspan         = colunas;
            tabela.AddCell(cell);
        }
示例#4
0
        public void AdicionaCelula(Tabela tabela, string texto, string BaseFont_, int tamanho, int alinhamento, int colunas)
        {
            Chunk    chunk = new Chunk(texto, FontFactory.GetFont(BaseFont_, tamanho));
            PdfPCell cell  = new PdfPCell(new Paragraph(chunk));

            cell.HorizontalAlignment = alinhamento;
            cell.Colspan             = colunas;
            tabela.AddCell(cell);
        }
示例#5
0
        public void Parte1(PDF pdf, string titulo, bool idt_inicial, DateTime data_inicial, bool idt_final, DateTime data_final)
        {
            Tabela   table = new Tabela(22);
            PdfPCell cell;

            cell = new PdfPCell();
            cell.AddElement(Parte11());
            cell.Colspan = 4;
            table.AddCell(cell);

            cell = new PdfPCell();
            cell.AddElement(Parte12(titulo, idt_inicial, data_inicial, idt_final, data_final));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell = new PdfPCell();
            cell.AddElement(Parte13());
            cell.Colspan = 7;
            table.AddCell(cell);

            pdf.doc.Add(table);
        }
示例#6
0
        private PdfPTable Parte12(string titulo, bool idt_inicial, DateTime data_inicial, bool idt_final, DateTime data_final)
        {
            Tabela table = new Tabela(1);
            Celula cell;
            Chunk  chunk;

            chunk        = new Chunk(titulo, FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16));
            cell         = new Celula(new Phrase(chunk));
            cell.Padding = 1;
            //cell.Colspan = 11;
            table.AddCell(cell);
            if (idt_inicial || idt_final)
            {
                string periodo = "Período: ";
                if (idt_inicial && idt_final)
                {
                    periodo += "de " + data_inicial.ToString("dd/MM/yyyy") + " até " + data_final.ToString("dd/MM/yyyy");
                }
                else
                {
                    if (idt_inicial)
                    {
                        periodo += "a partir de " + data_inicial.ToString("dd/MM/yyyy");
                    }
                    else
                    {
                        periodo += "até " + data_final.ToString("dd/MM/yyyy");
                    }
                }
                chunk        = new Chunk(periodo, FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 14));
                cell         = new Celula(new Phrase(chunk));
                cell.Padding = 1;
                //cell.Colspan = 11;
                table.AddCell(cell);
            }

            return(table);
        }