Code: Select all | Expand
METHOD PrintBarcode(cCode,nLine,nLeft,nType,nWidth,nHeigth,lBanner,lHorz,cFont,nColor) CLASS TLabel
local nRow := ::nRow +nLine
local nCol := ::Column() +nLeft
Local oPrint := ::oDevice
DEFAULT nWidth := 0.03 ,;
nHeigth := 0.6 ,;
lHorz := .t. ,;
nColor := CLR_BLACK ,;
lBanner := .f. ,;
cFont := 'arial'
// 1 = Code 39 ..
// 2 = Code 39 check digit
// 3 = Code 128 auto select
// 4 = Code 128 mode A
// 5 = Code 128 mode B
// 6 = Code 128 mode C
// 7 = EAN 8 ..
// 8 = EAN 13 ..
// 9 = UPC-A ...
// 10 = Codabar ...
// 11 = Suplemento 5 ..
// 12 = Industrial 2 of 5 ..
// 13 = Industrial 2 of 5 check digit
// 14 = Interlaved 2 of 5 ..
// 15 = Interlaved 2 of 5 check digit
// 16 = Matrix 2 of 5 ...
// 17 = Matrix 2 of 5 check digit
Do case
Case nType==1
Code3_9(nRow,nCol,cCode,oPrint,.f.,nColor,lHorz,nWidth,nHeigth)
Case nType==2
Code3_9(nRow,nCol,cCode,oPrint,.t.,nColor,lHorz,nWidth,nHeigth)
Case nType==3
Code128(nRow,nCol,cCode,oPrint,"",nColor,lHorz,nWidth,nHeigth)
Case nType==4
Code128(nRow,nCol,cCode,oPrint,"A",nColor,lHorz,nWidth,nHeigth)
Case nType==5
Code128(nRow,nCol,cCode,oPrint,"B",nColor,lHorz,nWidth,nHeigth)
Case nType==6
Code128(nRow,nCol,cCode,oPrint,"C",nColor,lHorz,nWidth,nHeigth)
Case nType==7
ean8(nRow,nCol,cCode,oPrint,nColor,lHorz,nWidth,nHeigth,lBanner,cFont)
Case nType==8
ean13(nRow,nCol,cCode,oPrint,nColor,lHorz,nWidth,nHeigth,lBanner,cFont)
Case nType==9
UPCA(nRow,nCol,cCode,oPrint,nColor,lHorz,nWidth,nHeigth,lBanner,cFont)
Case nType==10
Codabar(nRow,nCol,cCode,oPrint,nColor,lHorz,nWidth,nHeigth)
Case nType==11
sup5(nRow,nCol,cCode,oPrint,nColor,lHorz,nWidth,nHeigth,lBanner,cFont)
Case nType==12
ind25(nRow,nCol,cCode,oPrint,.f.,nColor,lHorz,nWidth,nHeigth)
Case nType==13
ind25(nRow,nCol,cCode,oPrint,.t.,nColor,lHorz,nWidth,nHeigth)
Case nType==14
int25(nRow,nCol,cCode,oPrint,.f.,nColor,lHorz,nWidth,nHeigth)
Case nType==15
int25(nRow,nCol,cCode,oPrint,.t.,nColor,lHorz,nWidth,nHeigth)
Case nType==16
mat25(nRow,nCol,cCode,oPrint,.f.,nColor,lHorz,nWidth,nHeigth)
Case nType==17
mat25(nRow,nCol,cCode,oPrint,.t.,nColor,lHorz,nWidth,nHeigth)
Endcase
Return Nil
Code: Select all | Expand
#include "FiveWin.ch"
#include ".\include\label.ch"
#include ".\include\Barcode.ch"
//static cSendCode := "*51111+40759*"
//----------------------------------------------------------------------------//
FUNCTION label16()
local oLabel
local oPen1
local oFont1, oFont2, oFont3,oF1
USE "TEST" NEW SHARED ALIAS "TEST"
DEFINE PEN oPen1 WIDTH 2
DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10 BOLD
DEFINE FONT oFont2 NAME "DEMOEAN 13" SIZE 0,36
DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-20 BOLD
* DEFINE FONT oF1 NAME "Code 128" SIZE 0, -50
LABEL oLabel SIZE 70, 70 ;
SEPARATORS 5, 2 ;
ON LINE 2 ;
PEN oPen1 ;
FILE "LABEL.PRN" ;
PREVIEW ;
TO FILE "LABEL.TXT" ;
CAPTION ( REPDEMO->DESCRIP );
FONT oFont1, oFont2, oFont3
LBLITEM AT 250 DATA "From :" FONT 1
LBLITEM AT 250 DATA "Antonio Linares SOFTWARE" FONT 1
LBLITEM AT 250 DATA "Urb. El Rosario. Avd. Rosario 34A" FONT 1
LBLITEM AT 250 DATA "29600 Marbella - SPAIN" FONT 1
LBLITEM AT 250 DATA "Phone/Fax: 34-5-2834830" FONT 1
LBLITEM DATA REPLICATE("-", 60) FONT 1
LBLITEM AT 250 DATA "To : " FONT 1
LBLITEM AT 250 DATA TEST->FIRST FONT 1
LBLITEM AT 250 DATA TEST->LAST FONT 1
LBLITEM AT 250 DATA TEST->STREET FONT 1
LBLITEM DATA REPLICATE("-", 60) FONT 1
LBLITEM AT 250 DATA "Send Code : " FONT 1
// LBLITEM DATA char2Ean(cSendCode) FONT 2 CENTERED
END LABEL oLabel
/*
Modificamos los margenes
*/
oLabel:Margin( 0.1, RPT_TOP, RPT_MMETERS )
oLabel:Margin( 0.1, RPT_BOTTOM, RPT_MMETERS )
/*
Modificamos los Colores
*/
oLabel:SetTxtColor(CLR_BLUE,1)
ACTIVATE LABEL oLabel ;
ON STARTLABEL oLabel:PrintBarcode( STR(TEST->SALARY),1100,200,1)
CLOSE TEST
/*
Ending
*/
oPen1:End()
oFont1:End()
oFont2:End()
oFont3:End()
RETURN NIL
//---------------------------------------------------------------------------//
// 16 = Matrix 2 of 5 ...