FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Imprimir un Codigo de barras en TReport (Solucionado)
Posts: 257
Joined: Mon Jun 10, 2013 06:40 PM
Imprimir un Codigo de barras en TReport (Solucionado)
Posted: Sun Nov 23, 2014 08:14 PM

Que tal, buen d铆a.
Alguien ya ha pasado por esto, tengo que imprimir un c贸digo
de barras en un reporte que tengo echo con tReport

Estoy probando con la lib de Cayetano, pero no logra dar como ponerlo
alguien que me pueda echar un hilo?

Gracias de antemano.

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Imprimir un Codigo de barras en TReport
Posted: Sun Nov 23, 2014 09:10 PM
Yo llamo a una function en el ENDPAGE del ACTIVATE REPORT en la que ejecuto la funcion EAN13

Code (fw): Select all Collapse
.../...
聽 聽 聽 ACTIVATE REPORT oRpt FOR ( (oBj:cAliasImp)->num_fac = nValor1 );
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽ON STARTPAGE Change(,oRpt) ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽ON ENDPAGE FinalRpt(,oRpt,1,, (oBj:aAlias[nArCab])->num_fac)


Code (fw): Select all Collapse
Function FinalRpt( nMt , oRpt , nTip , lRecuadro, nVal )
Local nFTop 聽 := oRpt:PhyHeight()
Local nCBy1 聽 := oRpt:PhyWidth()
Local nColCom := 0.4
Local ...
.../...

if lBarrasDoc 聽 // variable est谩tica 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //0.9
聽 聽 聽 EAN13( nFBar, nCBar, StrZero(nVal,12), oRpt:oDevice, ,.t., nWidthBar, 0.6 ,.t., )
//EAN13( nFBar, nCBar, "BCD-005-006", oRpt:oDevice, ,.t., nWidthBar, 0.6 ,.t., )

endif

.../...
Return Nil



No se si es la misma version que tu tienes (mi Prg se llama Barlib.prg)
Code (fw): Select all Collapse
Function ean13(nRow,nCol,cCode,oPrint,Color,lHorz,nWidth,nHeigth,;
聽 聽 聽 聽 lBanner,cFont)
聽 聽 local nLen
聽 聽 // test de parametros
聽 聽 // por implementar
聽 聽 default nHeigth := 1.5
聽 聽 default lBanner:=.f.
聽 聽 // desplazamiento...
聽 聽 if lHorz
聽 聽 聽 聽 go_code(_ean13(cCode),nRow,nCol,oPrint,lHorz,Color,nWidth,nHeigth*0.90)
聽 聽 else
聽 聽 聽 聽 nLen :=round 聽( nHeigth * 10 * oPrint:nHorzRes() / oPrint:nHorzSize(), 0 )*0.1
聽 聽 聽 聽// 10% espacios
聽 聽 聽 聽 聽 聽 go_code(_ean13(cCode),nRow,nCol+nLen,oPrint,lHorz,Color,nWidth,nHeigth*0.90)
聽 聽 end
聽 聽 if lBanner
聽 聽 聽 聽 go_code(_ean13Bl(),nRow,nCol,oPrint,lHorz,Color,nWidth,nHeigth)
聽 聽 聽 聽 barlen13(cCode,oPrint,nRow,nCol,Color,lHorz,nWidth,nHeigth,cFont)
聽 聽 end
return nil
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 257
Joined: Mon Jun 10, 2013 06:40 PM
Re: Imprimir un Codigo de barras en TReport
Posted: Sun Nov 23, 2014 10:16 PM

En tu funci贸n de EAN13 como calculas tu columna y tu rengl贸n ?

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Imprimir un Codigo de barras en TReport
Posted: Sun Nov 23, 2014 10:20 PM
Prueba y error
En mi caso
Code (fw): Select all Collapse
Local nWidthBar := 0.03 //0.025
Local nFBar   :=  560    //420
Local nCBar   := 3485    //265
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 257
Joined: Mon Jun 10, 2013 06:40 PM
Re: Imprimir un Codigo de barras en TReport
Posted: Sun Nov 23, 2014 10:35 PM

Amigo, solucionado, ya quedo bien, lo pase a cm y lo pongo donde yo quiero
y lo mejor es que el lector si lo lee

Mil gracias.

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Imprimir un Codigo de barras en TReport (Solucionado)
Posted: Wed Apr 20, 2016 11:43 AM

Cristobal,
How I can insert it on Treport class ? ( rcolumn.prg)
I wish print a list of products ( code,Desc,) and his barcode.
But I not Know wich type because the final user set it on app
I use Barlib
sample :
code Desc barcode
xxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxx

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Imprimir un Codigo de barras en TReport (Solucionado)
Posted: Wed Apr 20, 2016 02:42 PM
Silvio.Falconi wrote:Cristobal,
How I can insert it on Treport class ? ( rcolumn.prg)
I wish print a list of products ( code,Desc,) and his barcode.
But I not Know wich type because the final user set it on app
I use Barlib
sample :
code Desc barcode
xxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxx



Silvio, No I've never needed
But to do testing: define your column as ( try with file not exist )

viewtopic.php?f=3&t=21145&p=112918&hilit=report+bitmap#p112918

and define your height of data the column

Try with ON ENDLINE/ ON STARLINE for print your codebar

I have not tried it
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion