|
Postada em 17/10/2007 21:10 hs
Amigos, estou dando um loop em uma rotina, acontece que eu estou somando umas variáveis, eu estou colocando um traço para a soma, acontece que cada vez que eu passo pelo loop ele está colocando um traço. Se eu tiver 10 serviços ele coloca 10 traços! 120,00 300,00 400,00 500,00 -------- 1320,00 e ele está fazendo isso: 120,00 -------- 300,00 -------- 400,00 -------- 500,00 -------- eu tenho varios serviços e não pode colocar fora do loop ! Obrigado
|
|
|
|
|
Postada em 17/10/2007 21:12 hs
Olá novamente colega... veja como vc está separando os serviços. Para ajudar melhor coloque o código por favor. Obrigado :)
|
|
|
|
Postada em 17/10/2007 21:35 hs
rs.sort = "cod ASC" DO while no RS.EOF IF strCOD <> RS("COD") THEN PRINTER.PRINT PRINTER.PRINT RS("COD"); RS("DESCRICAO"); RS("VALOR") strCOD = RS("COD") ENDIF PRINTER.PRINT RS("COMPLEMENTO");RS("VALOR_CUSTO");RS("DATA") DesCusto = rs("COMPL_CUSTO") VlCusto = rs("VALOR") DtMovim = rs("DATA_MOVTO") Printer.CurrentX = 1: Printer.Print DesCusto; Printer.CurrentX = 129: Printer.Print Format(VlCusto, "##,##00.00"); Printer.CurrentX = 169: Printer.Print DtMovim Printer.CurrentY = Printer.CurrentY - 5.5 Soma = Soma + VlCusto Total = VlCompra + Soma Printer.CurrentY = Printer.CurrentY + 0.8 Printer.CurrentX = 120: Printer.Print String(17, "_"); Printer.CurrentY = Printer.CurrentY + 5 Printer.CurrentX = 129: Printer.Print Format(Soma, "##,##00.00"); Printer.FontBold = True Printer.CurrentX = 70: Printer.Print "Total de Custo(s)"; Printer.CurrentY = Printer.CurrentY + 5 Printer.CurrentX = 1: Printer.Print "Total do(s) Custo(s)"; Printer.FontBold = False Printer.CurrentX = 80: Printer.Print Format(Total, "R$ "##,##00.00");
Printer.CurrentY = Printer.CurrentY + 2 Printer.CurrentX = 1: Printer.Print String(95, "_");
RS.MOVENEXT LOOP
|
|
|
|
Postada em 18/10/2007 08:39 hs
O 1320 que vc colocou no primeiro post é a impressão de qual variável? Pois se vc quer que a linha apareça apenas 1x tem que ter uma condição ou, pelo que vejo, tem que estar fora do loop
|
|
|
|
Postada em 18/10/2007 19:00 hs
tb concordo que tenha que ficar fora do loop, mas acontece que são vários registros, vários códigos. O 1320,00 é a variável total. obrigado
|
|
|
|
Postada em 19/10/2007 08:45 hs
Mas você não está armazenando o total? Quando sair fora do loop o total vai estar lá você só vai mostrando os itens e depois do término do loop faça algo assim: Printer.CurrentX = 80: Printer.Print Format(Total, "R$ "##,##00.00");
Printer.CurrentY = Printer.CurrentY + 2 Printer.CurrentX = 1: Printer.Print String(95, "_");
ok? Acho que isso resolve a não ser que eu não tenha entendido o que está ocorrendo. Qualquer dúvida posta. at+
|
|
|
|