103 lines
2.8 KiB
Plaintext
103 lines
2.8 KiB
Plaintext
{
|
|
================================================================
|
|
PROGRAMA :IPPRRP021
|
|
OBJETIVO :IMPRIMIR LAS ETIQUETAS DE LOS PRODUCTOS
|
|
FECHA :DICIEMBRE 11 20,2010
|
|
}
|
|
|
|
GLOBALS
|
|
"ipprgb000.4gl"
|
|
|
|
DEFINE codigo_dp CHAR(10),
|
|
descripcion_dp CHAR(50)
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL ARG_VAL(1) RETURNING usuarios
|
|
CALL ARG_VAL(2) RETURNING clave
|
|
|
|
|
|
CONNECT to "sqlconnect" user usuarios USING clave
|
|
|
|
|
|
CALL acprrp010()
|
|
END MAIN
|
|
|
|
FUNCTION acprrp010()
|
|
DEFINE codigo_act CHAR(12),
|
|
pcodn,pcodgrupo,pcodtipo,pcodsec SMALLINT,
|
|
descripcion_act char(50)
|
|
|
|
|
|
DEFINE handler om.SaxDocumentHandler, -- return value from fgl_report_commitCurrentSettings()
|
|
salida,r_filename STRING, -- filename of Report Design Document including .4rp extension
|
|
r_output STRING, -- output format option
|
|
preview INTEGER -- TRUE/FALSE, to set preview option
|
|
|
|
OPEN WINDOW w1 AT 10,1 WITH FORM "ipfmrp034"
|
|
CONSTRUCT BY NAME criterio ON a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec
|
|
|
|
LET selec = "SELECT a.cod_n ,a.cod_grupo, ",
|
|
"a.cod_tipo,a.cod_sec,a.descrip_esp,a.descrip_ing",
|
|
" FROM intb00001 a ",
|
|
" WHERE ",criterio CLIPPED
|
|
|
|
|
|
PREPARE comando FROM selec
|
|
DECLARE busca CURSOR FOR comando
|
|
|
|
LET r_filename = "ipprrp010.4rp"
|
|
IF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
|
|
LET r_output='SVG'
|
|
LET preview=1
|
|
CALL fgl_report_selectDevice(r_output) -- changing default
|
|
CALL fgl_report_selectPreview(preview) -- changing default
|
|
LET handler = fgl_report_commitCurrentSettings() -- commit changes
|
|
END IF
|
|
|
|
START REPORT activos TO "dummy"
|
|
IF handler IS NOT NULL THEN -- report engine was configured ok
|
|
|
|
|
|
FOREACH busca INTO pcodn,pcodgrupo,pcodtipo,pcodsec,descripcion_act,codigo_dp
|
|
LET codigo_act = pcodn USING "<<<","-",pcodgrupo USING "<<<",'-',
|
|
pcodtipo USING "<<<",'-',pcodsec USING "<<<"
|
|
OUTPUT TO REPORT activos(codigo_act,descripcion_act,codigo_dp)
|
|
END FOREACH
|
|
END IF
|
|
FINISH REPORT activos
|
|
|
|
END FUNCTION
|
|
|
|
REPORT activos(x,descripcion,xcodigodp)
|
|
DEFINE x CHAR(12),
|
|
|
|
barcodigo_act CHAR(128),
|
|
descripcion CHAR(50),
|
|
xcodigodp CHAR(10)
|
|
ORDER BY x
|
|
FORMAT
|
|
BEFORE GROUP OF x
|
|
|
|
#ON EVERY ROW
|
|
LET barcodigo_act = "STARTB",codigo_128(x)
|
|
|
|
PRINTX x,codigo_dp,descripcion,barcodigo_act
|
|
END REPORT
|
|
|
|
FUNCTION codigo_128(cod_val)
|
|
|
|
DEFINE x INTEGER,
|
|
aux_str,barcode,cod_val STRING
|
|
|
|
LET aux_str=cod_val
|
|
|
|
LET barcode=""
|
|
|
|
FOR x=1 TO LENGTH(aux_str)
|
|
LET barcode=barcode,",",aux_str.getCharAt(x)
|
|
END FOR
|
|
LET barcode=barcode
|
|
RETURN barcode
|
|
|
|
END FUNCTION |