Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 02-12-2005
jmlifi jmlifi is offline
Miembro
 
Registrado: abr 2005
Posts: 188
Poder: 20
jmlifi Va por buen camino
Error imprimiendo: "printing in progress"

Código Delphi [-]
 tengo el siguiente codigo:

procedure ActivaImpresora(const s: string);
var
   Device, Name, Port : array[0..100] of char;
   DevMode            : THandle;
begin
 with printer do begin
     if s<>'' then begin
        PrinterIndex :=printers.IndexOf(s);
     end
     else
        PrinterIndex := -1;
     GetPrinter(Device, Name, Port, DevMode);
     SetPrinter(Device, Name, Port, 0);
   end;
end;
 
----------------------------------------------------------------------------------------------
procedure TPiezasFrm.EtiquetaBtnClick(Sender: TObject);
var Prn   : TPrn;
    t : integer;
begin
    t:= 1;
    uno:= 2;
    dos:= 4;
    tres:= 5;
    cuatro:= 6;
    cinco:= 7;
    par:= false;
    VerConjuntos.Close;
    VerConjuntos.ParamByName('codigo').AsString := PiezasREF_N.AsString;
    VerConjuntos.ParamByName('c_vr').AsString := PiezasVRSION.AsString;
    VerConjuntos.Open;
      //if Verconjuntos.IsEmpty then
      //imprimeetiquetas(0);
    If not VerConjuntos.IsEmpty then begin
       ActivaImpresora(Principal.PrnEtiqueta);
       Prn.Init(Printer.Canvas,'Arial',10,true);
       Prn.EscalaSep(1,1.0);
       Printer.Orientation  := poPortrait;
       Printer.BeginDoc;
 
          VerConjuntos.first;
          while t<=8 do begin
             while not VerConjuntos.Eof do begin
               if (t>1) and (par=false) then begin
                  uno:=uno+7;
                  dos:=dos+7;
                  tres:=tres+7;
                  cuatro:=cuatro+7;
                  cinco:=cinco+7;
               end;
               ImprimeUnaEtiqueta(Prn,VerConjuntosCANT.AsInteger);
               if par=false then begin
                  par:=true;
                  VerConjuntos.Next;
               end
               else begin
                  par:=false;
                  VerConjuntos.Next;
                  break;
               end;
 
             end;
              inc(t);
           end;
        ActivaImpresora('')
      end;
end;

ActivaImpresora(Principal.PrnEtiqueta) no tengo problemas, pero todavía no me llega a imprimir
ActivaImpresora('') PrinterIndex coge valor -1 y me salta el error "printing in progress". si comento esta parte, la impresosa me marca 1 documento ha imprimir pero no me imprime nada. Cuando cierro la aplicacion es cuando imprime.

Última edición por vtdeleon fecha: 02-12-2005 a las 16:08:21.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 22:11:20.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi