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 Parte1() { Tabela table = new Tabela(31); PdfPCell cell; cell = new PdfPCell(); cell.AddElement(Parte11()); cell.Colspan = 4; table.AddCell(cell); cell = new PdfPCell(); cell.AddElement(Parte12()); cell.Colspan = 11; table.AddCell(cell); cell = new PdfPCell(); cell.AddElement(Parte13()); cell.Colspan = 7; table.AddCell(cell); cell = new PdfPCell(); cell.AddElement(Parte14()); cell.Colspan = 9; table.AddCell(cell); doc.Add(table); }
private void RodapeFornecedor(string observacao) { Tabela table = new Tabela(6); table.AddCell(Celula2("Observações", 1, true)); table.AddCell(Celula2(observacao, 5, false)); doc.Add(table); }
private void Totais(Tabela table, float total, float desconto, bool por_fabrica) { if (!por_fabrica) { table.AddCell(CelulaGrid("Desconto", 22, true, false)); table.AddCell(CelulaGrid(desconto.ToString("###,###,##0.00"), 2, true, true)); } table.AddCell(CelulaGrid("Valor Final", 22, true, false)); table.AddCell(CelulaGrid((total - desconto).ToString("###,###,##0.00"), 2, true, true)); }
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); }
private PdfPTable Parte13() { Tabela table = new Tabela(1); Celula cell; cell = new Celula(Frase("No PEDIDO FÁBRICA: ", NRO_PEDIDO_FORNEC.ToString(), 10)); table.AddCell(cell); cell = new Celula(Frase("DATA: ", DateTime.Now.ToString("dd/MM/yyyyy"), 10)); table.AddCell(cell); cell = new Celula(Frase("REPRESENTANTE: ", Globais.sFilial, 10)); table.AddCell(cell); return(table); }
private void CabecalhoRelatorio() { Tabela table = new Tabela(4); 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; cell.BorderWidthBottom = 1; cell.Colspan = 1; table.AddCell(cell); cell = new PdfPCell(new Phrase(new Chunk("Relatório de Pedidos", FontFactory.GetFont(BaseFont.HELVETICA, 18)))); cell.BorderWidth = 0; cell.BorderWidthBottom = 1; cell.Colspan = 2; cell.VerticalAlignment = Element.ALIGN_MIDDLE; cell.HorizontalAlignment = Element.ALIGN_CENTER; table.AddCell(cell); cell = new PdfPCell(new Phrase(new Chunk(DateTime.Now.ToString("d/M/yyyy"), FontFactory.GetFont(BaseFont.HELVETICA, 18)))); cell.BorderWidth = 0; cell.BorderWidthBottom = 1; cell.Colspan = 1; cell.VerticalAlignment = Element.ALIGN_MIDDLE; cell.HorizontalAlignment = Element.ALIGN_CENTER; table.AddCell(cell); doc.Add(table); }
private PdfPTable Parte12() { Tabela table = new Tabela(11); Celula cell; Chunk chunk; chunk = new Chunk("PEDIDO DE FÁBRICA", FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16)); cell = new Celula(new Phrase(chunk)); cell.Padding = 1; cell.Colspan = 11; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Padding = 1; cell.Colspan = 11; table.AddCell(cell); 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); chunk = new Chunk("PEDIDO DE VENDA", FontFactory.GetFont(BaseFont.HELVETICA, 8)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 4; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 1; cell.BorderWidth = 1; table.AddCell(cell); chunk = new Chunk("ASSISTÊNCIA TÉCNICA", FontFactory.GetFont(BaseFont.HELVETICA, 8)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 5; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 11; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 1; cell.BorderWidth = 1; table.AddCell(cell); chunk = new Chunk("ALTERÇÃO PEDIDO DE VENDA", FontFactory.GetFont(BaseFont.HELVETICA, 8)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 10; table.AddCell(cell); return(table); }
private PdfPTable Parte11() { Tabela table = new Tabela(1); PdfPCell cell; Chunk chunk; string logo = "imagens\\" + COD_FORNECEDOR + ".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); }
public static 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); }
public static 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); }
private static PdfPTable Parte13() { Tabela table = new Tabela(1); Celula cell; cell = new Celula(Frase("DATA: ", DateTime.Now.ToString("dd/MM/yyyyy"), 10)); table.AddCell(cell); return(table); }
private static PdfPTable Parte12(string titulo, string sub_titulo) { 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); chunk = new Chunk(sub_titulo, FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16)); cell = new Celula(new Phrase(chunk)); cell.Padding = 1; //cell.Colspan = 11; table.AddCell(cell); return(table); }
private void CabecalhoPedido(string COD_FORNECEDOR, DateTime DAT_ORCAMENTO, short COD_ORCAMENTO, int NRO_PEDIDO, string vendedor, string observacao) { Tabela table = new Tabela(1); PdfPCell cell; doc.Add(new Paragraph("")); doc.Add(new Paragraph("")); cell = new PdfPCell(new Phrase(new Chunk("Pedido " + COD_FORNECEDOR.Trim() + " - " + NRO_PEDIDO.ToString()))); cell.BorderWidth = 0; table.AddCell(cell); doc.Add(table); table = new Tabela(6); table.AddCell(Celula2("Vendedor", 1, true)); table.AddCell(Celula2(vendedor, 5, false)); table.AddCell(Celula2("Observações", 1, true)); table.AddCell(Celula2(observacao, 5, false)); doc.Add(table); }
private void CabecalhoFornecedor(string COD_FORNECEDOR) { Tabela table = new Tabela(1); PdfPCell cell; doc.Add(new Paragraph("")); doc.Add(new Paragraph("")); cell = new PdfPCell(new Phrase(new Chunk("Fornecedor " + COD_FORNECEDOR.Trim()))); cell.BorderWidth = 0; table.AddCell(cell); doc.Add(table); }
public static void Cabecalho(Document doc, string titulo, string sub_titulo) { 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, sub_titulo)); cell.Colspan = 11; table.AddCell(cell); cell = new PdfPCell(); cell.AddElement(Parte13()); cell.Colspan = 7; table.AddCell(cell); doc.Add(table); }
private void Parte1(PDF pdf, string titulo) { 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)); cell.Colspan = 11; table.AddCell(cell); cell = new PdfPCell(); cell.AddElement(Parte13()); cell.Colspan = 7; table.AddCell(cell); pdf.doc.Add(table); }
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); if (por_vendedor) { cell = new Celula(Frase("VENDEDOR: ", vendedor, 10)); } else if (por_consultor) { cell = new Celula(Frase("CONSULTOR: ", consultor, 10)); } else if (por_filial) { cell = new Celula(Frase("FILIAL: ", Globais.sFilial, 10)); } table.AddCell(cell); return(table); }
private void CabecalhoTabela(Tabela table, bool mostrar_valores) { //doc.Add(new Paragraph("")); //doc.Add(new Paragraph("")); PdfPCell cell = CelulaGrid("", mostrar_valores ? 24 : 12, true, false); cell.BorderWidth = 0; table.AddCell(cell); table.AddCell(CelulaGrid("Item", mostrar_valores ? 4 : 2, true, false)); table.AddCell(CelulaGrid("Descrição", mostrar_valores ? 6 : 5, true, false)); table.AddCell(CelulaGrid("Códigos Específicos", mostrar_valores ? 4 : 3, true, false)); table.AddCell(CelulaGrid("Qtde", 2, true, false)); if (mostrar_valores) { table.AddCell(CelulaGrid("Unitário", 2, true, true)); table.AddCell(CelulaGrid("Total", 2, true, true)); table.AddCell(CelulaGrid("IPI", 2, true, true)); table.AddCell(CelulaGrid("Total c/ IPI", 2, true, true)); } }
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); }
private void Parte4(Cabecalho2_Pedido cab2, bool mostrar_valores) { Chunk chunk; Celula cell; Tabela table = new Tabela(31); // linha1 cell = new Celula(Frase("", 10)); cell.Colspan = mostrar_valores ? 22 : 31; table.AddCell(cell); if (mostrar_valores) { chunk = new Chunk("TOTAL GERAL COM IPI", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 6; table.AddCell(cell); chunk = new Chunk(total.ToString("###,###,##0.00"), FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 10)); cell = new Celula(new Phrase(chunk)); cell.HorizontalAlignment = Element.ALIGN_RIGHT; cell.BorderWidth = 1; cell.Colspan = 3; table.AddCell(cell); } // linha2 chunk = new Chunk("No PEDIDO REPRESENTANTE", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 4; table.AddCell(cell); chunk = new Chunk(NRO_PEDIDO.ToString(), FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 4; cell.BorderWidth = 1; cell.HorizontalAlignment = Element.ALIGN_CENTER; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 1; table.AddCell(cell); chunk = new Chunk("No O.C. CLIENTE", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 4; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 4; cell.BorderWidth = 1; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 1; table.AddCell(cell); chunk = new Chunk("No PED ESPECIAL", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 5; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 4; cell.BorderWidth = 1; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 4; table.AddCell(cell); // linha3 string observacao = cab2.observacao; string[] linhas = observacao.Split('\n'); int lin = 0; foreach (string linha in linhas) { if (++lin == 1) { chunk = new Chunk("OBS: ", FontFactory.GetFont(BaseFont.HELVETICA, 10)); } else { chunk = new Chunk("", FontFactory.GetFont(BaseFont.HELVETICA, 10)); } cell = new Celula(new Phrase(chunk)); cell.Colspan = 2; cell.VerticalAlignment = Element.ALIGN_BOTTOM; table.AddCell(cell); chunk = new Chunk(linha, FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 29; cell.VerticalAlignment = Element.ALIGN_BOTTOM; cell.BorderWidthBottom = 1; table.AddCell(cell); } /* * chunk = new Chunk("OBS:", FontFactory.GetFont(BaseFont.HELVETICA, 10)); * cell = new Celula(new Phrase(chunk)); * cell.Colspan = 2; * cell.VerticalAlignment = Element.ALIGN_BOTTOM; * table.AddCell(cell); * * chunk = new Chunk(cab2.observacao, FontFactory.GetFont(BaseFont.HELVETICA, 10)); * cell = new Celula(new Phrase(chunk)); * cell.Colspan = 29; * cell.BorderWidthBottom = 1; * table.AddCell(cell); * * // linha4 * cell = new Celula(new Phrase("")); * cell.Colspan = 31; * cell.BorderWidthBottom = 1; * table.AddCell(cell); */ // linha5 cell = new Celula(new Phrase("")); cell.Colspan = 31; table.AddCell(cell); chunk = new Chunk("PEDIDO APROVADO", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 5; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 1; cell.BorderWidth = 1; table.AddCell(cell); chunk = new Chunk("SIM", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 2; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 1; cell.BorderWidth = 1; table.AddCell(cell); chunk = new Chunk("NÃO", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 2; table.AddCell(cell); chunk = new Chunk("ASS. CLIENTE:", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 4; cell.VerticalAlignment = Element.ALIGN_BOTTOM; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 6; cell.BorderWidthBottom = 1; table.AddCell(cell); chunk = new Chunk("ASS. REPRES:", FontFactory.GetFont(BaseFont.HELVETICA, 10)); cell = new Celula(new Phrase(chunk)); cell.Colspan = 4; cell.VerticalAlignment = Element.ALIGN_BOTTOM; table.AddCell(cell); cell = new Celula(new Phrase("")); cell.Colspan = 6; cell.BorderWidthBottom = 1; table.AddCell(cell); doc.Add(table); }
private void Parte3(ArrayList areas, bool mostrar_valores) { CelulaCabecalho cell; CelulaItem cellI; Tabela table = new Tabela(mostrar_valores ? 31 : 24); // cabecalho cell = new CelulaCabecalho(Frase("ITEM", 10)); cell.Colspan = 1; table.AddCell(cell); cell = new CelulaCabecalho(Frase("QTD", 10)); cell.Colspan = 1; table.AddCell(cell); cell = new CelulaCabecalho(Frase("COD FIXO", 10)); cell.Colspan = 2; table.AddCell(cell); cell = new CelulaCabecalho(Frase("COD VARIÁVEL", 10)); cell.Colspan = 5; table.AddCell(cell); cell = new CelulaCabecalho(Frase("DESCRIÇÃO", 10)); cell.Colspan = 11; table.AddCell(cell); cell = new CelulaCabecalho(Frase("MEDIDA", 10)); cell.Colspan = 4; table.AddCell(cell); if (mostrar_valores) { cell = new CelulaCabecalho(Frase("R$ UNIT S/IPI", 10)); cell.Colspan = 3; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase("IPI%", 10)); cell.Colspan = 1; table.AddCell(cell); cell = new CelulaCabecalho(Frase("R$ TOTAL C/IPI", 10)); cell.Colspan = 3; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); } total = 0; int seq = 0; foreach (Area area in areas) { foreach (Item item in area.itens) { // itens char letra = (char)((int)'A' + seq++); string s = letra.ToString(); cellI = new CelulaItem(Frase(s, 10)); // item cellI.Colspan = 1; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.qtde.ToString(), 10)); // qtd cellI.Colspan = 1; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.codigo, 10)); // fixo cellI.Colspan = 2; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.especificos, 10)); // variavel cellI.Colspan = 5; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.descricao, 10)); // descricao cellI.Colspan = 11; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.medidas, 10)); // medida cellI.Colspan = 4; table.AddCell(cellI); if (mostrar_valores) { cellI = new CelulaItem(Frase(item.vlr_semipi.ToString("###,###,##0.00"), 10)); // sem ipi cellI.Colspan = 3; cellI.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.ipi.ToString(), 10)); // ipi cellI.Colspan = 1; table.AddCell(cellI); cellI = new CelulaItem(Frase(item.vlr_unitario.ToString("###,###,##0.00"), 10)); // com ipi cellI.Colspan = 3; cellI.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cellI); } total += item.vlr_unitario; } } doc.Add(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); }
private void Parte2(DataGridView dgv, bool justificativas) { CelulaCabecalho cell; CelulaItem cellI; Tabela table = new Tabela(11); // cabecalho cell = new CelulaCabecalho(Frase("Fornecedor", 10)); cell.Colspan = 2; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Data", 10)); cell.Colspan = 1; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Orçamento", 10)); cell.Colspan = 1; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Pedido", 10)); cell.Colspan = 1; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Cliente", 10)); cell.Colspan = 2; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Vlr Pedido", 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Valor", 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase("%Pago", 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Comissão", 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); percentual_comissao = 0; total_comissao = 0; total_pedido = 0; total_valor = 0; total_pago = 0; total_pagar = 0; nitens = 0; foreach (DataGridViewRow row in dgv.Rows) { /* * if (!(bool)row.Cells["S"].Value) * { * continue; * } * bool pg=false; * if (por_vendedor) * pg = row.Cells["IdtVendedor"].Value.ToString().Equals("S"); * if (por_consultor) * pg = row.Cells["IdtConsultor"].Value.ToString().Equals("S"); * if (por_filial) * pg = row.Cells["IdtFilial"].Value.ToString().Equals("S"); */ bool pg = (bool)row.Cells["PG"].Value; if (!mostra_pagar && !pg) { continue; } if (!mostra_pago && pg) { continue; } cellI = new CelulaItem(Frase(row.Cells["Fornecedor"].Value.ToString(), 10)); cellI.Colspan = 2; table.AddCell(cellI); cellI = new CelulaItem(Frase(row.Cells["Data"].Value.ToString(), 10)); cellI.Colspan = 1; table.AddCell(cellI); cellI = new CelulaItem(Frase(row.Cells["Orcamento"].Value.ToString(), 10)); cellI.Colspan = 1; table.AddCell(cellI); cellI = new CelulaItem(Frase(row.Cells["Pedido"].Value.ToString(), 10)); cellI.Colspan = 1; table.AddCell(cellI); cellI = new CelulaItem(Frase(row.Cells["Cliente"].Value.ToString(), 10)); cellI.Colspan = 2; table.AddCell(cellI); cellI = new CelulaItem(Frase(Globais.StrToFloat(row.Cells["ValorPedido"].Value.ToString()).ToString("#,###,##0.00"), 10)); cellI.Colspan = 1; cellI.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cellI); cellI = new CelulaItem(Frase(Globais.StrToFloat(row.Cells["Valor"].Value.ToString()).ToString("#,###,##0.00"), 10)); cellI.Colspan = 1; cellI.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cellI); //cellI = new CelulaItem(Frase(Globais.StrToFloat(row.Cells["PerVendedor"].Value.ToString()).ToString("#0.00"), 10)); cellI = new CelulaItem(Frase(Globais.StrToFloat(row.Cells["Pago"].Value.ToString()).ToString("#0.00"), 10)); cellI.Colspan = 1; cellI.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cellI); float comissao = Globais.StrToFloat(row.Cells["Comissao"].Value.ToString()); //float valor = Globais.StrToFloat(row.Cells["Valor"].Value.ToString()); //float per_pago = Globais.StrToFloat(row.Cells["PerVendedor"].Value.ToString()); //float comissao = per_pago * valor / 100f; cellI = new CelulaItem(Frase(comissao.ToString("#,###,##0.00"), 10)); cellI.Colspan = 1; cellI.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cellI); percentual_comissao += Globais.StrToFloat(row.Cells["Pago"].Value.ToString()); total_comissao += comissao; total_pedido += Globais.StrToFloat(row.Cells["ValorPedido"].Value.ToString()); total_valor += Globais.StrToFloat(row.Cells["Valor"].Value.ToString()); if ((bool)row.Cells["PG"].Value) { total_pago += comissao; } else { total_pagar += comissao; } if (justificativas) { string justificativa = row.Cells["Justificativa"].Value.ToString().Trim(); if (justificativa.Length > 0) { cellI = new CelulaItem(Frase("Justificativa: " + justificativa, 10)); cellI.Colspan = 11; table.AddCell(cellI); } } nitens++; } doc.Add(table); }
private void Parte3() { Tabela table = new Tabela(11); PdfPCell cell; cell = new CelulaCabecalho(Frase("Total", 10)); cell.Colspan = 7; table.AddCell(cell); cell = new CelulaCabecalho(Frase(total_pedido.ToString("#,###,##0.00"), 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase(total_valor.ToString("#,###,##0.00"), 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); float media = (percentual_comissao / nitens); cell = new CelulaCabecalho(Frase(media.ToString("#0.00"), 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase(total_comissao.ToString("#,###,##0.00"), 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase("", 10)); cell.Colspan = 9; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Pago", 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase(total_pago.ToString("#,###,##0.00"), 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); // cell = new CelulaCabecalho(Frase("", 10)); cell.Colspan = 9; table.AddCell(cell); cell = new CelulaCabecalho(Frase("Pagar", 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); cell = new CelulaCabecalho(Frase(total_pagar.ToString("#,###,##0.00"), 10)); cell.Colspan = 1; cell.HorizontalAlignment = Element.ALIGN_RIGHT; table.AddCell(cell); doc.Add(table); }