Report ( error (6) deleting enchanced metafile

Report ( error (6) deleting enchanced metafile

Postby Patricio Avalos Aguirre » Fri Mar 14, 2008 12:31 pm

Estimados

En ocasiones me sale este error ( error (6) deleting )

pero no es por que me falta un ENDPAGE, si no es por que sobrepasa la hoja al parecer, mi consulta es como se hace para que cuando finalize el report me imprima n lineas, que puede se 1 a n..

Lo estoy haciendo Asi y el problema esta en ON END SayMemo2( oReport, aFactu ) ;

Code: Select all  Expand view
ACTIVATE REPORT oReport ;
         ON CHANGE ;
               ( ;
               SayMemo( oReport, aCentral[nPos,7] ),;
               );
         ON END SayMemo2( oReport, aFactu )  ;
         WHILE nPos <= Len( aCentral )

static Function SayMemo( oReport, aArray )

   if !empty( aArray )
      aEval( aArray, { |x| ;
                     ;
                     oReport:StartLine(),;
                     oReport:Say(1,space(5)+x[1]),;
                     oReport:Say(3,padr(x[2],25)),;
                     oReport:Say(4,x[3]),;
                     oReport:Say(5,x[4]),;
                     oReport:Say(6,x[5]),;
                     oReport:EndLine();
                     } )
   endif

return( nil )
//----------------------------------------------------------------------------------------------------
static Function SayMemo2( oReport, aArray )
   local cLine, lEnd := .f.

   if !empty( aArray )
      aEval( aArray, { |x| ;
                     ;
                     oReport:StartLine(),;
                     oReport:Say(1,space(5)+x[1]),;
                     oReport:Say(3,padR(x[2],25)),;
                     oReport:Say(4,trans(x[3],"99,999,999") ),;
                     oReport:Say(5,trans(x[4],"99,999,999") ),;
                     oReport:EndLine();
                      } )
   endif

return( nil )
//----------------------------------------------------------------------------------------------------
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Postby Armando » Fri Mar 14, 2008 2:04 pm

Patricio:

El problema se presenta cuando imprimes más alla del final de la página, intenta ampliando el márgen inferior del reporte o utiliza el siguiente código por cada línea impresa en la función SayMemo2

IF oReporte:NeedNewPage()
oReporte:EndPage()
oReporte:StartPage()
ENDIF

Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3120
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby Patricio Avalos Aguirre » Fri Mar 14, 2008 3:29 pm

Gracias armando por responder

segui tus indicaciones pero aun sale el error..

Code: Select all  Expand view
static Function SayMemo2( oReport, aArray )

   if !empty( aArray )
      aEval( aArray, { |x| ;
                     ;
                     iif( oReport:NeedNewPage(),(oReport:EndPage(), oReport:StartPage()), NIL  ),;
                     oReport:StartLine(),;
                     oReport:Say(1,space(5)+x[1]),;
                     oReport:Say(3,padR(x[2],25)),;
                     oReport:Say(4,trans(x[3],"99,999,999") ),;
                     oReport:Say(5,trans(x[4],"99,999,999") ),;
                     oReport:EndLine();
                      } )
   endif

return( nil )
//----------------------------------------------------------------------------------------------------


ahora probando esto
Code: Select all  Expand view
static Function SayMemo2( oReport, aArray )
   local nStdLineHeight := oReport:nStdLineHeight

   if !empty( aArray )
      aEval( aArray, { |x| ;
                     ;
                     iif( oReport:NeedNewPage( nStdLineHeight ),(oReport:EndPage(), oReport:StartPage() ), NIL  ),;
                     oReport:StartLine(),;
                     oReport:Say(1,space(5)+x[1]),;
                     oReport:Say(3,padR(x[2],25)),;
                     oReport:Say(4,trans(x[3],"99,999,999") ),;
                     oReport:Say(5,trans(x[4],"99,999,999") ),;
                     oReport:EndLine();
                      } )
   endif

return( nil )


igual sale el error pero por lo menos lanza una segunda pagina :-)

si alguien tiene otra solucion es bienvenida
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Postby Armando » Fri Mar 14, 2008 4:02 pm

Patricio:

Yo intentaría ponerlo despues de imprimir:

static Function SayMemo2( oReport, aArray )
local cLine, lEnd := .f.

if !empty( aArray )
aEval( aArray, { |x| ;
;
oReport:StartLine(),;
oReport:Say(1,space(5)+x[1]),;
oReport:Say(3,padR(x[2],25)),;
oReport:Say(4,trans(x[3],"99,999,999") ),;
oReport:Say(5,trans(x[4],"99,999,999") ),;
oReport:EndLine();
IIF(oReporte:NeedNewPage(),;
(oReporte:EndPage(),oReporte:StartPage()),)} )
endif

return( nil )

Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3120
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 12 guests

cron