necesito ayuda con codigos de barras y con archivos jpg

necesito ayuda con codigos de barras y con archivos jpg

Postby Gerardo Farfan » Fri Oct 28, 2005 4:20 pm

Codigos de Barra
Resulta que estoy usando la barlib (de cayetano), pero no me funciona, este es parte de mi codigo:


Function ImprimeCB(nTipoBarra,nCuantos,cCodigoProd,cNomArtic)
Local oPrn,oFont,oFong,oFonc,oFonr,oFonm,lCondi,vRow:=1,xStep,yStep,vCont
Local vTitle:=tRazon,vCodeB,vPage:=0,vCort:=1
CursorWait()
PRINT oPrn PREVIEW TITLE "Imprimiendo Códigos de Barra"
oPrn:lPrvModal := .T.
DEFINE FONT oFonr NAME "ARIAL" SIZE 0,-7 OF oPrn
DEFINE FONT oFonc NAME "ARIAL" SIZE 0,-5 OF oPrn
DEFINE FONT oFont NAME "ARIAL" SIZE 0,-15 BOLD OF oPrn
DEFINE FONT oFonm NAME "ARIAL" SIZE 0,-19 BOLD OF oPrn
DEFINE FONT oFong NAME "ARIAL" SIZE 0,-22 OF oPrn
PAGE
oPrn:CmSay(vRow,1,vTitle,oFont,2,CLR_BLUE)
vRow:=vRow+0.5
oPrn:CmSay(vRow,1,AllTrim(cNomArtic),oFont,2,CLR_BLUE)
vRow ++
FOR vCont:=1 To nCuantos
vCodeB:=AllTrim(cCodigoProd)
oPrn:CmSay(vRow,1,vCodeB,,2,CLR_BLACK)
vRow:=vRow+0.5
If vCont>50
ENDPAGE
PAGE
vRow:=1
oPrn:CmSay(vRow,1,cNomArtic,oFont,2,CLR_BLUE)
vRow++
EndIf
NEXT
ENDPAGE
vRow:=1
PAGE
FOR vCont:=1 To nCuantos
vCodeB:=AllTrim(cCodigoProd)
oPrn:CmSay(vRow,1,cNomArtic,oFont,2,CLR_BLUE)
oPrn:CmSay(vRow+0.5,1,vCodeB,oFonr,2,CLR_BLACK)
Do Case
Case nTipoBarra=1 ; @ vRow+0.8,1 CM_CODABAR vCodeB OF oPrn
Case nTipoBarra=2 ; @ vRow+0.8,1 CM_CODE128 vCodeB OF oPrn
Case nTipoBarra=3 ; @ vRow+0.8,1 CM_CODE3_9 vCodeB OF oPrn
Case nTipoBarra=4 ; @ vRow+0.8,1 CM_EAN13 vCodeB OF oPrn
Case nTipoBarra=5 ; @ vRow+0.8,1 CM_EAN8 vCodeB OF oPrn
Case nTipoBarra=6 ; @ vRow+0.8,1 CM_INT25 vCodeB OF oPrn
Case nTipoBarra=7 ; @ vRow+0.8,1 CM_IND25 vCodeB OF oPrn
Case nTipoBarra=8 ; @ vRow+0.8,1 CM_MAT25 vCodeB OF oPrn
Case nTipoBarra=9 ; @ vRow+0.8,1 CM_SUP5 vCodeB OF oPrn
Case nTipoBarra=10 ; @ vRow+0.8,1 CM_UPCA vCodeB OF oPrn


por mas que le busco no me imprime el codigo de barra (imprime: nombre de la empresa, clave del producto), tengo al principio el barcode.ch

archivos jpg
tengo el sig. codigo:

Function VerFoto(Vars,oDlg)
local oBmp
msginfo(vars)
If AllTrim(Vars)=AllTrim(Artic->Foto)
MemoWrit("$Foto.bmp",AllTrim(Artic->Foto))
EndIf
*REDEFINE BITMAP oBmp ID 103 FILENAME "$Foto.bmp" OF oDlg update
oDlg:UPDATE() ; oDlg:aEvalWhen()
Return(.T.)


ademas la guardo en un campo memo de la siguiente forma:

Artic->NomFoto:=aVars[15,2]
nHandle:=FOpen(".\Fotos\"+aVars[15,2])
tFile:=""
Do While .T.
nRead:=FRead(nHandle,@cBuff,255)
tFile+=Left(cBuff,nRead)
If nRead != 255
Exit
EndIf
EndDo
FClose(nHandle)
// Guarda foto en campo memo
If Rec_Lock(.5)
Replace Artic->Foto With tFile
DBCommit() ; DBUnLock()
EndIf
DBCOMMITALL() ; DBUNLOCKALL()


dentro del folder en donde muestro la foto tiene el sig. codigo:

Redefine GET aVars[15,1] VAR aVars[15,2] ID 102 OF aVars[1,1]:aDialogs[3]
ReDefine Button ID 809 OF aVars[1,1]:aDialogs[3] Action(VerFoto(aVars[15,2],aVars[1,1]:aDialogs[3])) UPDATE
REDEFINE BITMAP oBmp ID 103 FILENAME "$Foto.bmp" OF aVars[1,1]:aDialogs[3] update


pero nunca me muestra la figura y cuando me lo llega a hacer, en el siguiente articulo me muestra la foto del articulo anterior.

como se soluciona esto????
uso clipper 5.3b blinker y fivewin 2.2

de antemano muchas gracias por su ayuda
Gerardo Farfan
 
Posts: 52
Joined: Fri Oct 28, 2005 3:42 pm
Location: Mexico, D.F.

Postby Pepe Leyva » Fri Nov 04, 2005 5:35 am

Hola Gerardo.
Yo uso el tipo CODE128. Al principio me daba problemas, pero poniendole el modo "B" va de maravilla.

Un saludo.
Pepe Leyva.
Pepe Leyva
 
Posts: 3
Joined: Fri Nov 04, 2005 5:24 am


Return to FiveWin para CA-Clipper

Who is online

Users browsing this forum: No registered users and 13 guests

cron