private PdfPTable Parte14()
        {
            Tabela table = new Tabela(1);
            Celula cell;
            Chunk  chunk;

            chunk = new Chunk(NOM_PARCEIRO, FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);

            chunk = new Chunk(DES_LOGRADOURO + "," + NRO_ENDERECO + " - " + NOM_CIDADE + " - " + COD_ESTADO, FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);

            chunk = new Chunk("Fone: " + FONE.PoeEdicao(NRO_FONE1) + " - Fax: " + FONE.PoeEdicao(NRO_FAX), FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);

            chunk = new Chunk("CEP: " + CEP.PoeEdicao(NRO_CEP) + " - " + DES_EMAIL, FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);
            return(table);
        }
        private void Parte2(Cabecalho2_Pedido cab2)
        {
            Tabela table = new Tabela(31);
            Celula cell;

            // linha1
            cell         = new Celula(Frase("CLIENTE: ", cab2.cliente, 10));
            cell.Colspan = 22;
            table.AddCell(cell);

            cell         = new Celula(Frase("CONTATO: ", cab2.contato, 10));
            cell.Colspan = 22;
            table.AddCell(cell);

            // linha2
            cell         = new Celula(Frase("ENDEREÇO: ", cab2.endereco + "," + cab2.numero, 10));
            cell.Colspan = 22;
            table.AddCell(cell);

            cell         = new Celula(Frase("E-mail: ", cab2.email, 10));
            cell.Colspan = 9;
            table.AddCell(cell);

            // linha3
            cell         = new Celula(Frase("BAIRRO: ", cab2.bairro, 10));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell         = new Celula(Frase("CIDADE: ", cab2.cidade, 10));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell         = new Celula(Frase("UF: ", cab2.estado, 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            cell         = new Celula(Frase("CEP: ", CEP.PoeEdicao(cab2.cep), 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            // linha4
            cell         = new Celula(Frase("CNPJ: ", cab2.cnpj, 10));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell         = new Celula(Frase("INCRIÇÃO ESTADUAL: ", cab2.ie, 10));
            cell.Colspan = 16;
            table.AddCell(cell);

            cell         = new Celula(Frase("FONE: ", FONE.PoeEdicao(cab2.fone), 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            // linha4
            if (cab2.entrega.Trim().Length > 0)
            {
                cell = new Celula(Frase("LOCAL DE ENTREGA: ",
                                        cab2.entrega.Trim() + "," + cab2.numero_entrega.Trim() + " - " +
                                        cab2.compl_entrega.Trim() + " - " +
                                        cab2.bairro_entrega.Trim() + " - " + cab2.cidade_entrega.Trim() +
                                        cab2.estado_entrega.Trim() + " - " +
                                        CEP.PoeEdicao(cab2.cep_entrega), 10));
            }
            else
            {
                cell = new Celula(Frase("LOCAL DE ENTREGA: ", "IDEM", 10));
            }
            cell.Colspan = 31;
            table.AddCell(cell);

            // linha5
            if (cab2.cobranca.Trim().Length > 0)
            {
                cell = new Celula(Frase("LOCAL DE COBRANÇA: ",
                                        cab2.cobranca.Trim() + "," + cab2.numero_cobranca.Trim() + " - " +
                                        cab2.compl_cobranca.Trim() + " - " +
                                        cab2.bairro_cobranca.Trim() + " - " + cab2.cidade_cobranca.Trim() +
                                        cab2.estado_cobranca.Trim() + " - " +
                                        CEP.PoeEdicao(cab2.cep_cobranca), 10));
            }
            else
            {
                cell = new Celula(Frase("LOCAL DE COBRANÇA: ", "IDEM", 10));
            }
            cell.Colspan = 31;
            table.AddCell(cell);

            // linha6
            cell         = new Celula(Frase("FRETE: % ", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            if (IDT_FRETE == 'C')
            {
                cell = new Celula(new Phrase(""));
            }
            else
            {
                Chunk chunk = new Chunk("X", FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16));
                cell = new Celula(new Phrase(chunk));
            }
            cell.Colspan     = 1;
            cell.BorderWidth = 1;
            table.AddCell(cell);

            cell         = new Celula(Frase("FORNECEDOR", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            if (IDT_FRETE == 'C')
            {
                Chunk chunk = new Chunk("X", FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16));
                cell = new Celula(new Phrase(chunk));
            }
            else
            {
                cell = new Celula(new Phrase(""));
            }
            cell.Colspan     = 1;
            cell.BorderWidth = 1;
            table.AddCell(cell);

            cell         = new Celula(Frase("CLIENTE", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            cell         = new Celula(Frase("TRANSPORTADORA: ", "", 10));
            cell.Colspan = 12;
            table.AddCell(cell);

            cell         = new Celula(Frase("FONE: ", "", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            // linha7
            cell         = new Celula(Frase("CONDIÇÕES DE PAGAMENTO: ", "", 10));
            cell.Colspan = 8;
            table.AddCell(cell);

            cell         = new Celula(Frase("SINAL-R$ ", "", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            cell         = new Celula(Frase("PARCELAS 1-R$ ", "", 10));
            cell.Colspan = 6;
            table.AddCell(cell);

            cell         = new Celula(Frase("2-R$ ", "", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            cell         = new Celula(Frase("3-R$ ", "", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            cell         = new Celula(Frase("4-R$ ", "", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            // linha8
            cell         = new Celula(Frase("SAÍDA DA FÁBRICA: ", "", 10));
            cell.Colspan = 19;
            table.AddCell(cell);

            cell         = new Celula(Frase("DESCONTO: ", "", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            cell         = new Celula(Frase("ENC FINANCEIRO: ", "", 10));
            cell.Colspan = 7;
            table.AddCell(cell);
            doc.Add(table);
        }
Exemple #3
0
        public Table GeraCabecalho2(bool bVendedor, string vendedor, string observacao)
        {
            Table table = new Table(6);

            table.TableFitsPage   = true;
            table.BorderWidth     = 1;
            table.Padding         = 4;
            table.WidthPercentage = 100;
            table.Alignment       = Element.ALIGN_LEFT;
            table.AddCell(Celula2("Cliente", 1, true));
            table.AddCell(Celula2(cab2.cliente, 3, false));
            table.AddCell(Celula2("CPF/CNPJ", 1, true));
            table.AddCell(Celula2(cab2.cnpj, 1, false));
            table.AddCell(Celula2("Endereço", 1, true));
            table.AddCell(Celula2(cab2.endereco.Trim() + " " +
                                  cab2.numero.Trim() + " - " +
                                  cab2.compl.Trim() + "\r\n" +
                                  cab2.bairro.Trim() + " - " +
                                  cab2.cidade.Trim() + " - " +
                                  cab2.estado.Trim() + " - " +
                                  "CEP " + CEP.PoeEdicao(cab2.cep), 3, false));
            table.AddCell(Celula2("IE", 1, true));
            table.AddCell(Celula2(cab2.ie, 1, false));

            table.AddCell(Celula2("Local Entrega", 1, true));
            if (cab2.entrega.Trim().Length > 0)
            {
                table.AddCell(Celula2(cab2.entrega.Trim() + " " +
                                      cab2.numero_entrega.Trim() + " - " +
                                      cab2.compl_entrega.Trim() + "\r\n" +
                                      cab2.bairro_entrega.Trim() + " - " +
                                      cab2.cidade_entrega.Trim() + " - " +
                                      cab2.estado_entrega.Trim() + " - " +
                                      "CEP " + CEP.PoeEdicao(cab2.cep), 3, false));
            }
            else
            {
                table.AddCell(Celula2(cab2.endereco.Trim() + " " +
                                      cab2.numero.Trim() + " - " +
                                      cab2.compl.Trim() + "\r\n" +
                                      cab2.bairro.Trim() + " - " +
                                      cab2.cidade.Trim() + " - " +
                                      cab2.estado.Trim() + " - " +
                                      "CEP " + CEP.PoeEdicao(cab2.cep), 3, false));
            }
            table.AddCell(Celula2("IM", 1, true));
            table.AddCell(Celula2(cab2.im, 1, false));

            table.AddCell(Celula2("Contato", 1, true));
            table.AddCell(Celula2(cab2.contato, 1, false));

            table.AddCell(Celula2("Fone", 1, true));
            string fones = FONES.Concatena(cab2.fone, cab2.fone2, cab2.celular, cab2.fone1_parceiro, cab2.fone2_parceiro, cab2.celular_parceiro);

            table.AddCell(Celula2(fones, 1, false));

            table.AddCell(Celula2("email", 1, true));
            table.AddCell(Celula2(cab2.email, 1, false));
            if (bVendedor)
            {
                table.AddCell(Celula2("Vendedor", 1, true));
                table.AddCell(Celula2(vendedor, 5, false));
                table.AddCell(Celula2("Observações", 1, true));
                table.AddCell(Celula2Bold(observacao, 5, false));
            }
            return(table);
            //doc.Add(table);
        }
Exemple #4
0
        private void CabecalhoCliente(string COD_FORNECEDOR, DateTime DAT_ORCAMENTO, short COD_ORCAMENTO, bool servico)
        {
            cPedidos   pedido     = new cPedidos();
            cPedidoPDF pedido_pdf = new cPedidoPDF();

            pedido_pdf.cab2 = pedido.DadosCabecalho2(COD_FORNECEDOR, DAT_ORCAMENTO, COD_ORCAMENTO, servico);

            Tabela table = new Tabela(6);

            table.AddCell(Celula2("Cliente", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.cliente, 3, false));
            table.AddCell(Celula2("CPF/CNPJ", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.cnpj, 1, false));

            table.AddCell(Celula2("Endereço", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.endereco.Trim() + " " +
                                  pedido_pdf.cab2.numero.Trim() + " - " +
                                  pedido_pdf.cab2.compl.Trim() + "\r\n" +
                                  pedido_pdf.cab2.bairro.Trim() + " - " +
                                  pedido_pdf.cab2.cidade.Trim() + " - " +
                                  pedido_pdf.cab2.estado.Trim() + " - " +
                                  "CEP " + CEP.PoeEdicao(pedido_pdf.cab2.cep), 3, false));
            table.AddCell(Celula2("IE", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.ie, 1, false));

            table.AddCell(Celula2("Local Entrega", 1, true));
            if (pedido_pdf.cab2.entrega.Trim().Length > 0)
            {
                table.AddCell(Celula2(pedido_pdf.cab2.entrega.Trim() + " " +
                                      pedido_pdf.cab2.numero_entrega.Trim() + " - " +
                                      pedido_pdf.cab2.compl_entrega.Trim() + "\r\n" +
                                      pedido_pdf.cab2.bairro_entrega.Trim() + " - " +
                                      pedido_pdf.cab2.cidade_entrega.Trim() + " - " +
                                      pedido_pdf.cab2.estado_entrega.Trim() + " - " +
                                      "CEP " + CEP.PoeEdicao(pedido_pdf.cab2.cep), 3, false));
            }
            else
            {
                table.AddCell(Celula2(pedido_pdf.cab2.endereco.Trim() + " " +
                                      pedido_pdf.cab2.numero.Trim() + " - " +
                                      pedido_pdf.cab2.compl.Trim() + "\r\n" +
                                      pedido_pdf.cab2.bairro.Trim() + " - " +
                                      pedido_pdf.cab2.cidade.Trim() + " - " +
                                      pedido_pdf.cab2.estado.Trim() + " - " +
                                      "CEP " + CEP.PoeEdicao(pedido_pdf.cab2.cep), 3, false));
            }
            table.AddCell(Celula2("IM", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.im, 1, false));

            table.AddCell(Celula2("Contato", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.contato, 1, false));

            table.AddCell(Celula2("Fone", 1, true));
            string fones = FONES.Concatena(pedido_pdf.cab2.fone, pedido_pdf.cab2.fone2, pedido_pdf.cab2.celular, pedido_pdf.cab2.fone1_parceiro, pedido_pdf.cab2.fone2_parceiro, pedido_pdf.cab2.celular_parceiro);

            table.AddCell(Celula2(fones, 1, false));

            table.AddCell(Celula2("email", 1, true));
            table.AddCell(Celula2(pedido_pdf.cab2.email, 1, false));
            doc.Add(table);
        }
Exemple #5
0
        private void GeraCabecalho1()
        {
            Table table = new Table(4);

            table.TableFitsPage   = true;
            table.WidthPercentage = 100;
            table.BorderWidth     = 0;
            table.Padding         = 1;
            Chunk chunk;
            Cell  cell;

            // coluna1 - logo
            Image img;
            float largura = 1000F;
            float altura  = 1000F;

            try
            {
                img = Image.GetInstance(cab1.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 Cell(chunk);
            cell.BorderWidth = 0;
            table.AddCell(cell);

            // coluna2 - orcamento
            Paragraph par = new Paragraph();

            par.Add(new Chunk(" orçamento:", FontFactory.GetFont(BaseFont.HELVETICA, 18)));
            par.Add(new Chunk(cab1.orcamento.ToString() + "\n\n", FontFactory.GetFont(BaseFont.HELVETICA, 22)));
            par.Add(new Chunk(" " + cab1.data.ToString("d/M/yyyy"), FontFactory.GetFont(BaseFont.HELVETICA, 18)));
            cell = new Cell(par);
            cell.BorderWidthTop      = 1;
            cell.BorderWidthBottom   = 1;
            cell.BorderWidthLeft     = 1;
            cell.BorderWidthRight    = 0;
            cell.HorizontalAlignment = Element.ALIGN_LEFT;
            cell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            table.AddCell(cell);

            // coluna3 - dados empresa
            string dados_empresa =
                cab1.filial + " \n" +
                cab1.rua + "," + cab1.nro + " " + cab1.complemento + " \n" +
                "CEP: " + CEP.PoeEdicao(cab1.cep) +
                " - Fone: " + FONE.PoeEdicao(cab1.fone) +
                " - Fax: " + FONE.PoeEdicao(cab1.fax) + " \n" +
                cab1.email + " ";

            chunk = new Chunk(dados_empresa, FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Cell(chunk);
            cell.BorderWidthTop      = 1;
            cell.BorderWidthBottom   = 1;
            cell.BorderWidthLeft     = 0;
            cell.BorderWidthRight    = 1;
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            cell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            cell.Colspan             = 2;
            table.AddCell(cell);

            doc.Add(table);
        }