Ver Mensaje Individual
  #12  
Antiguo 11-10-2010
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
A ver asi:
Código Delphi [-]
procedure TFfactura.btn3Click(Sender: TObject);
begin
 if wfactura_a_imprimir<>0 then
  begin
    Application.CreateForm(TFticket, Fticket);
  //  Fticket.show;
   Fticket.Dataset:= Qry_ticket;
   with Fticket.Qry_ticket do
    begin
      sql.Clear;
      SQL.Add('select * from facturaItem');
      sql.Add('where nofac=factura');
      Parameters.ParamByName('pfactura').Value:=wfactura_a_imprimir;
      try
       Open;
       if not Fticket.Qry_ticket.IsEmpty then
         begin
           while not Fticket.Qry_ticket.Eof do
           begin
            Fticket.txtcantidad.Caption:=FieldByname('cantidad').AsVariant;
            Fticket.Refresh;
             Next;
           end;
          Fticket.Preview;
          Fticket.Free;
         end;
       except
        on E:EOleException do
         begin
          MessageDlg(Format('Error: %s    Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
         end;
       end;
    end;
  end;  
end;
Saludos
__________________
Siempre Novato
Responder Con Cita