Fórum WriteLn #235732
02/06/2004
0
Var
P : TextFile;
vDescricao : string ;
vQuantidade : Integer ;
vValor : Currency ;
begin
While ADOTable1.Eof = false do
AssignPrn(P);
Rewrite(P);
Writeln(P, ´ Nota de Venda´);
begin
vDescricao := ADOTable1DESCRICAO.AsString ;
vQuantidade := ADOTable1QUANTIDADE.AsInteger ;
vValor := ADOTable1VALOR.AsCurrency ;
ADOTable1.Next ;
try
Writeln(P, vDescricao + IntToStr(vQuantidade) + FloatToStr(vValor)) ;
finally
CloseFile(P);
end;
end ;
end;
Obrigado,
[]s,
Micky
Curtir tópico
+ 0Posts
02/06/2004
Marcelo Saviski
Gostei + 0
02/06/2004
Walfrido
P : TextFile;
vDescricao : string ;
vQuantidade : Integer ;
vValor : Currency ;
begin
AssignPrn(P);
Rewrite(P);
Writeln(P, ´ Nota de Venda´);
with ADOTable1 do
begin
while not eof do
begin
vDescricao := ADOTable1DESCRICAO.AsString ;
vQuantidade := ADOTable1QUANTIDADE.AsInteger ;
vValor := ADOTable1VALOR.AsCurrency ;
Writeln(P, vDescricao + IntToStr(vQuantidade) + FloatToStr(vValor)) ;
next;
end;
CloseFile(P);
end;
Gostei + 0
02/06/2004
Micky
Marcelo, muito obrigado.
O Walfrido resolveu o problema.
Walfrido, deu tudo certinho, só falta formatar os dados.
Muito obrigado,
[ ]s,
Gostei + 0
03/06/2004
Walfrido
valor_formatado : String;
E onde quer formatar o valor faça isso...
valor_formatado := FormatFloat(´#,,0.00´, Table1.fieldByName(´valor_saldo´).asFloat);
WriteLn(F, 15 + ´VALOR :(+) ´ + Format(´¬11s´, [valor_formatado]));
Gostei + 0
03/06/2004
Micky
P : TextFile;
valor_formatado : String;
vDescricao : string ;
vQuantidade : Integer ;
begin
AssignPrn(P);
Rewrite(P);
Writeln(P, ´ Nota de Venda´);
with ADOTable1 do
begin
while not eof do
begin
vDescricao := ADOTable1DESCRICAO.AsString ;
vQuantidade := ADOTable1QUANTIDADE.AsInteger ;
//não aceitou fieldByName, ou melhor, depois que cliquei no ponto depois de ADOTable1, não tinha na janela aberta
// valor_formatado := FormatFloat(´#,,0.00´, ADOTable1.fieldByName(´valor_saldo´).asFloat);
valor_formatado := FormatFloat(´,,0.00´, ADOTable1VALOR.AsFloat) ;
//não aceitou essa linha, deu ilegal character $7D
// WriteLn(P, 15 + ´VALOR +) ´ + Format(´¬11s´, [valor_formatado]));}
//assim aceitou, porém o valor ficou desalinhado a quantidade e o valor na impressão
//será que não existe algum tipo de Tab ?
Writeln(P, vDescricao + ´ ´ + IntToStr(vQuantidade) + ´ ´ + Format(´¬11s´, [valor_formatado])) ;
next;
end;
CloseFile(P);
end;
end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)