Error al imprimir

74 views
Skip to first unread message

Marcelo Becker Vasquez

unread,
Mar 24, 2015, 10:32:41 AM3/24/15
to publice...@googlegroups.com
Hola amigos.

Tengo un problema que nunca me habia sucedido, se trata de que cuando genero los datos para hacer un reporte me sale el error de "Relacion Ciclica", nunca me habia pasado antes. A que se debe?

El codigo del boton que hace el llamado es el siguiente.

SELECT * FROM datosalis, itemsalis WHERE datosalis.rut = selfun.rut AND YEAR(datosalis.fec_dat) = lnAno AND MONTH(datosalis.fec_dat) = lnMes AND datosalis.rut = lcRut ;
AND datosalis.rut = itemsalis.rut INTO CURSOR seldat

GO TOP IN seldat
DO WHILE !EOF('seldat')
    APPEND BLANK IN margrid1
    REPLACE margrid1.diamar   WITH DAY(seldat.fec_dat) IN margrid1
    REPLACE margrid1.rutmar   WITH lcRut IN margrid1
    REPLACE margrid1.fecmar   WITH seldat.fec_dat IN margrid1
    REPLACE margrid1.sermar   WITH seldat.servicio IN margrid1
    REPLACE margrid1.orimar    WITH seldat.origen IN margrid1
    REPLACE margrid1.desmar   WITH seldat.destino IN margrid1
    REPLACE margrid1.am1mar  WITH IIF(!EMPTY(seldat.am1),ttoc(seldat.am1,2),' - ')
    REPLACE margrid1.am2mar  WITH IIF(!EMPTY(seldat.am2),ttoc(seldat.am2,2),' - ')
    REPLACE margrid1.pm1mar  WITH IIF(!EMPTY(seldat.pm1),ttoc(seldat.pm1,2),' - ')
    REPLACE margrid1.pm2mar  WITH IIF(!EMPTY(seldat.pm2),ttoc(seldat.pm2,2),' - ')
    REPLACE margrid1.noc1mar WITH IIF(!EMPTY(seldat.noc1),ttoc(seldat.noc1,2),' - ')
    REPLACE margrid1.noc2mar WITH IIF(!EMPTY(seldat.noc2),ttoc(seldat.noc2,2),' - ')
    REPLACE margrid1.tramar    WITH IIF(!EMPTY(seldat.trabajadas),TTOC(seldat.trabajadas,2),'- ')
    REPLACE margrid1.extmar   WITH IIF(!EMPTY(seldat.extras),TTOC(seldat.extras,2),'- ')
    REPLACE margrid1.menmar  WITH IIF(!EMPTY(seldat.menor),TTOC(seldat.menor,2),'- ')
    REPLACE margrid1.manmar  WITH IIF(!EMPTY(seldat.manejo),TTOC(seldat.manejo,2),'- ')
    REPLACE margrid1.totmar   WITH IIF(!EMPTY(seldat.total_hrs),TTOC(seldat.total_hrs,2),'- ')
    REPLACE margrid1.am2tie   WITH seldat.am2
    REPLACE margrid1.pm2tie   WITH seldat.pm2
    REPLACE margrid1.noc2tie  WITH seldat.noc2
    REPLACE margrid1.obsmar   WITH ALLTRIM(seldat.observacion)
   
SKIP 1 IN seldat
ENDDO

set console off
report form inf_alistacion.frx to printer prompt
set console on

Gracias de antemano.

Marcelo Becker Vasquez

unread,
Mar 24, 2015, 10:36:40 AM3/24/15
to publice...@googlegroups.com
Ok, lo repare, al parecer este error es por tener en el entorno de datos la misma relacion de tablas que en el formulario. La elimine y me mostro el reporte sin ningun problema.
--

Saludos

Marcelo Becker V.
Desarrollo y Soporte
cel. 662 672 25

Miguel Canchas

unread,
Mar 24, 2015, 10:52:05 AM3/24/15
to publice...@googlegroups.com

SELECT * FROM datosalis, itemsalis WHERE datosalis.rut = selfun.rut AND YEAR(datosalis.fec_dat) = lnAno AND MONTH(datosalis.fec_dat) = lnMes AND datosalis.rut = lcRut ;

AND datosalis.rut = itemsalis.rut INTO CURSOR seldat

 

SELECT seldat

SCAN

     

      INSERT INTO margrid1( diamar, rutmar  ,    fecmar  ,    sermar  ,    orimar  ,    desmar  ,    am1mar ,    am2mar ,    pm1mar ,    pm2mar , ;

    noc1mar ,    noc2mar ,    tramar  ,    extmar  ,    menmar  ,    manmar  ,    totmar  ,    am2tie  ,    pm2tie  ,    noc2tie ,    obsmar  ) values ;

      ( DAY(seldat.fec_dat) ,lcRut ,seldat.fec_dat,seldat.servicio ,seldat.origen ,seldat.destino ,

      IIF(!EMPTY(seldat.am1),ttoc(seldat.am1,2),' - '), ;

      IIF(!EMPTY(seldat.am2),ttoc(seldat.am2,2),' - '), ;

      IIF(!EMPTY(seldat.pm1),ttoc(seldat.pm1,2),' - '), ;

      IIF(!EMPTY(seldat.pm2),ttoc(seldat.pm2,2),' - '), ;

      IIF(!EMPTY(seldat.noc1),ttoc(seldat.noc1,2),' - '), ;

      IIF(!EMPTY(seldat.noc2),ttoc(seldat.noc2,2),' - '), ;

      IIF(!EMPTY(seldat.trabajadas),TTOC(seldat.trabajadas,2),'- '), ;

      IIF(!EMPTY(seldat.extras),TTOC(seldat.extras,2),'- '), ;

      IIF(!EMPTY(seldat.menor),TTOC(seldat.menor,2),'- '), ;

      IIF(!EMPTY(seldat.manejo),TTOC(seldat.manejo,2),'- '), ;

      IIF(!EMPTY(seldat.total_hrs),TTOC(seldat.total_hrs,2),'- '), ;

      seldat.am2, seldat.pm2, seldat.noc2,  ALLTRIM(seldat.observacion) )

 

ENDSCAN

 

set console off

report form inf_alistacion.frx to printer prompt

set console on

 

MK

Marcelo Becker Vasquez

unread,
Mar 24, 2015, 10:54:04 AM3/24/15
to publice...@googlegroups.com
Elimino el append blank y lo reemplazo por el Insert

Fernando D. Bozzo

unread,
Mar 26, 2015, 8:12:12 PM3/26/15
to publice...@googlegroups.com, mcan...@ximesa.com
Excelente Miguel! :D
Reply all
Reply to author
Forward
0 new messages