SELECT PRINTER PREVIEW

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
edufloriv
Posts: 136
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB
Location: PERU
Has thanked: 1 time
Been thanked: 4 times

SELECT PRINTER PREVIEW

Post by edufloriv » Tue May 22, 2018 8:27 pm

Saludos amigos,

Tengo un problema con el PREVIEW del SELECT PRINTER:

1 - Se abre la vista previa en pantalla.
2 - El usuario hace click accidentalmente en la ventana que esta detrás, perdiendo el enfoque y la ventana del preview se va atras.
3 - Al desaparecer del frente, el usuario piensa que se ha cerrado y vuelve a generar el preview.
4 - Se cierra todo el sistema.

Code: Select all

   SELECT PRINTER DEFAULT ;
      ORIENTATION PRINTER_ORIENT_PORTRAIT ;
      PAPERSIZE   PRINTER_PAPER_A4 ;
      QUALITY     PRINTER_RES_DRAFT ;
      PREVIEW

   START PRINTDOC NAME cDocNam
   ...
Se genera este errorlog.html :

Code: Select all

Date:22/05/18 Time: 15:21:22
Error BASE/1083 Error de argumento: *

Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) 
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) 
Called from _DOWINDOWEVENTPROCEDURE(6091) 
Called from EVENTS(1493) 
Called from DOMESSAGELOOP(0) 
Called from _ACTIVATEWINDOW(5717) 
Called from _HMG_PRINTER_SHOWPREVIEW(5283) 
Called from NOTAPRINT(1091) 
Called from NOTAREPRINT(995) 
Called from (b)NOTASDEINGRESO(70) 
Called from _DOCONTROLEVENTPROCEDURE(6056) 
Called from EVENTS(828) 
Called from DOMESSAGELOOP(0) 
Called from _ACTIVATEWINDOW(5717) 
Called from NOTASDEINGRESO(313) 
Called from ABREMODULO(365) 
Called from EJECUTAOPCION(335) 
Called from (b)MAIN(143) 
Called from _DOCONTROLEVENTPROCEDURE(6056) 
Called from EVENTS(1816) 
Called from DOMESSAGELOOP(0) 
Called from _ACTIVATEWINDOW(5717) 
Called from MAIN(211) 
Adicionalmente se genera este archivo hb_out.log :

Code: Select all

Application Internal Error - D:\EdDocs\HMGCom\InfoFarmaC\INFOFARMA.exe
Terminated at: 2018-05-22 15:21:23
Error irrecuperable 9003: Demasiadas llamadas recursivas al controlador de errores
Called from TYPE(0)
Called from _ISCONTROLDEFINED(1143) in source\h_controlmisc.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5678) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from C_MSGSTOP(0)
Called from SHOWERROR(181) in source\ErrorSys.prg
Called from DEFERROR(129) in source\ErrorSys.prg
Called from (b)ERRORSYS(66) in source\ErrorSys.prg
Called from _HMG_PRINTER_PREVIEW_ONPAINT(5737) in source\h_controlmisc.prg
Called from (b)_HMG_PRINTER_SHOWPREVIEW(5000) in source\h_controlmisc.prg
Called from _DOWINDOWEVENTPROCEDURE(6091) in source\h_windows.prg
Called from EVENTS(1493) in source\h_windows.prg
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717) in source\h_windows.prg
Called from _HMG_PRINTER_SHOWPREVIEW(5283) in source\h_controlmisc.prg
Called from NOTAPRINT(1091) in INFOFARMA.prg
Called from NOTAREPRINT(995) in INFOFARMA.prg
Called from (b)NOTASDEINGRESO(70) in INFOFARMA.prg
Called from _DOCONTROLEVENTPROCEDURE(6056) in source\h_windows.prg
Called from EVENTS(828) in source\h_windows.prg
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717) in source\h_windows.prg
Called from NOTASDEINGRESO(313) in INFOFARMA.prg
Called from ABREMODULO(365) in INFOFARMA.prg
Called from EJECUTAOPCION(335) in INFOFARMA.prg
Called from (b)MAIN(143) in INFOFARMA.prg
Called from _DOCONTROLEVENTPROCEDURE(6056) in source\h_windows.prg
Called from EVENTS(1816) in source\h_windows.prg
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717) in source\h_windows.prg
Called from MAIN(211) in INFOFARMA.prg
------------------------------------------------------------------------
¿ Hay forma de detectar si la ventana del preview ya esta abierta ? de esa forma podria evitar que ejecuten el proceso de nuevo y mejor aún si la puedo colocar al frente.

Se que tengo esto :

Code: Select all

IF IsWindowDefined(Win_Preview) = .T.
   MINIMIZE WINDOW Win_Preview
   RESTORE WINDOW Win_Preview
   RETURN
ENDIF
Pero no sé el nombre de la ventana del Preview.

Agradeceré su ayuda amigos.


Att.

Eduardo Flores Rivas


LIMA - PERU

User avatar
edufloriv
Posts: 136
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB
Location: PERU
Has thanked: 1 time
Been thanked: 4 times

Post by edufloriv » Wed May 23, 2018 2:06 pm

Amigos,

Gracias, encontré la solución:

Code: Select all

   IF IsWindowDefined( _HMG_PRINTER_SHOWPREVIEW ) = .T.
      MINIMIZE WINDOW _HMG_PRINTER_SHOWPREVIEW  // <- Este es el nombre de la ventana del preview
      RESTORE WINDOW _HMG_PRINTER_SHOWPREVIEW
      RETURN
   ENDIF

   SELE HNOTA
   SET ORDER TO TAG HNxNume
   DBSEEK( cQueNota )

   SELECT PRINTER DEFAULT ;
      ORIENTATION PRINTER_ORIENT_PORTRAIT ;
      PAPERSIZE   PRINTER_PAPER_A4 ;
      QUALITY     PRINTER_RES_DRAFT ;
      PREVIEW

   START PRINTDOC NAME cDocNam
Con esto logré evitar la salida del sistema, pero sería bueno reportar el bug. ¿ A quién puedo reportarlo ?


Un saludo cordial a todos.


Att.

Eduardo Flores Rivas


LIMA - PERU

Post Reply