FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour error (6) deleteing enhance metafile
Posts: 652
Joined: Wed Oct 19, 2005 12:03 PM
error (6) deleteing enhance metafile
Posted: Sun Dec 19, 2010 11:21 AM
Me ocurre en algunos listados, al aceptar me muestra el preview bien y lo mismo con la impresión, pero es bastante molesto el cartelito. Uso 7.12, bcc82, xharbour 1.21

El código
Code (fw): Select all Collapse
#include "Fivewin.ch"

function impcc1(aCcli,nclia,lprove)

local dresult:=  DEHASTA1() 
local oprn
local nsaldo := 0
local aMae:= iif(!lprove,Busnap(nclia),Buspro(nclia))
local n 
local nvalor := 0
local cnape
local z := 0
local oFont1, oFont2
 

 if empty(dresult)       
       return nil
 endif 
 
 cnape := aMae[2]

for z = 1 to len(aCCli)
      if aCCli[z,1] <= dresult[1]
          nsaldo := aCcli[z,5]
      nvalor := z +1
      else
          exit
      endif 
next

 PRINT oPrn title "Ctas Ctes" PREVIEW MODAL


DEFINE FONT oFont1 NAME "arial" SIZE 0,9  of oPrn
DEFINE FONT oFont2 NAME "arial" SIZE 0,9  BOLD of oPrn

oPrn:setup()

PAGE 

titulo(oprn,dresult,aMae,oFont1,oFont2) 

n := 2.4
if !empty(nsaldo)
    oPrn:CmSay(n,2,"Saldo al: " + dtoc(dresult[1]),oFont1,,,,0)
    oPrn:CmSay(n,17,transform(nsaldo,'@E 9,999,999.99'),oFont1,,,,0)
  endif
  iif(empty(nvalor), nvalor := 1, nvalor)
 
 for z = nvalor to len(aCCli)
        n += .3  
      oPrn:CmSay(n,1,transform(aCcli[z,1],"@d"),oFont1,,,,0)
      oPrn:CmSay(n,4,substr(oemtoansi(aCcli[z,2]),1,22),oFont1,,,,0)
      if !empty(aCcli[z,3])
          oPrn:CmSay(n,10,transform(aCcli[z,3],"@e 999,999.99"),oFont1,,,,0)
       else
          oPrn:CmSay(n,13.5 ,transform(aCcli[z,4],"@e 999,999.99"),oFont1,,,,0)
        endif
    oPrn:CmSay(n,17,transform(aCcli[z,5],"@e 9,999,999.99"),oFont1,,,,0)
       if   n >= 25  .or. z = len(aCcli) .or. aCcli[z,1] > dresult[2]
           n += .3
           oPrn:CmSay(n,0.5,replicate("_",120),oFont1,,,,0)
       oPrn:CmSay(n+.3,2,("Estado de cta. cte. al " + transform(aCcli[z,1],"@d")),oFont1,,,,0)
       oPrn:CmSay(n+.3,17,transform(aCcli[z,5],"@e 9,999,999.99"),oFont1,,,,0)
       oPrn:CmSay(n+.6,0.5,replicate("_",120),oFont1,,,,0)
           oPrn:EndPage()      
       if  aCcli[z,1] > dresult[2]
            exit
       endif
       IF z != len(aCcli)
           n := 0
           oPrn:StartPage() 
               titulo(oPrn,dresult,aMae)
               n := 2.4
           oPrn:CmSay(n,2,("Estado de cta. cte. al " + transform(aCcli[z,1],"@d")),oFont1,,,,0)
           oPrn:CmSay(n,17,transform(aCcli[z,5],"@e 9,999,999.99"),oFont1,,,,0)        
           endif
       endif

 
    next   
 
 


ENDPAGE

ENDPRINT


oFont1:end()
oFont2:end() 
oPrn:end()

return nil

/******************************************************************************************/
STATIC FUNCTION titulo(oPrn,dresult,aMae,oFont1,oFont2)
local ctitu := "Resumen de Cta Cte"
local clocal
local re := ""
local titu2

oPrn:CmSay(1,1,"QUIMICA MEGA S.A.",oFont2,,,,0)
 oPrn:CmSay(1.3, 1,aMae[2] ,oFont1,,,,0)
 iif(!empty(aMae[4]),re:= "-",.f.)
 oPrn:CmSay(1.6, 1, aMae[3],oFont1,,,,0)
oPrn:CmSay(1.6,16,"Desde el: " + dtoc(dresult[1]),oFont1,,,,0)
oPrn:CmSay(1.9,1,(alltrim(aMae[4]) + re +  alltrim(aMae[5])),oFont1,,,,0)
oPrn:CmSay(1.9,16,"Hasta el: "  + dtoc(dresult[2]),oFont1,,,,0)
oPrn:CmSay(2.0,0.5,replicate("_",120),oFont1,,,,0)
return nil


Estuve leyendo en anteriores artículos pero quizás no supe ver la respuesta...

Gracias
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: error (6) deleteing enhance metafile
Posted: Sun Dec 19, 2010 05:10 PM

Posiblemente estas haciendo una llamada extra a EndPage.

Comprueba que si llamas a oPrn:EndPage() luego no llames a ENDPAGE

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 652
Joined: Wed Oct 19, 2005 12:03 PM
Re: error (6) deleteing enhance metafile
Posted: Mon Dec 20, 2010 12:39 AM
El error esta en dónde está remarcado, gracias Antonio


for z = nvalor to len(aCCli)
n += .3
oPrn:CmSay(n,1,transform(aCcli[z,1],"@d"),oFont1,,,,0)
oPrn:CmSay(n,4,substr(oemtoansi(aCcli[z,2]),1,22),oFont1,,,,0)
if !empty(aCcli[z,3])
oPrn:CmSay(n,10,transform(aCcli[z,3],"@e 999,999.99"),oFont1,,,,0)
else
oPrn:CmSay(n,13.5 ,transform(aCcli[z,4],"@e 999,999.99"),oFont1,,,,0)
endif
oPrn:CmSay(n,17,transform(aCcli[z,5],"@e 9,999,999.99"),oFont1,,,,0)
if n >= 25 .or. z = len(aCcli) .or. aCcli[z,1] > dresult[2]
n += .3
oPrn:CmSay(n,0.5,replicate("_",120),oFont1,,,,0)
oPrn:CmSay(n+.3,2,("Estado de cta. cte. al " + transform(aCcli[z,1],"@d")),oFont1,,,,0)
oPrn:CmSay(n+.3,17,transform(aCcli[z,5],"@e 9,999,999.99"),oFont1,,,,0)
oPrn:CmSay(n+.6,0.5,replicate("_",120),oFont1,,,,0)
oPrn:EndPage()
if aCcli[z,1] > dresult[2]
exit
endif
IF z != len(aCcli)
n := 0
oPrn:StartPage()
titulo(oPrn,dresult,aMae)
n := 2.4
oPrn:CmSay(n,2,("Estado de cta. cte. al " + transform(aCcli[z,1],"@d")),oFont1,,,,0)
oPrn:CmSay(n,17,transform(aCcli[z,5],"@e 9,999,999.99"),oFont1,,,,0)
endif
endif

Continue the discussion