153 lines
4.2 KiB
Plaintext
153 lines
4.2 KiB
Plaintext
{
|
|
===========================================================================
|
|
PROGRAMA : ADPRRP001
|
|
OBJETIVO : Listar los departamentos
|
|
FECHA : Junio 22, 1993
|
|
REALIZADO POR : Ing. Betania Guerrero
|
|
===========================================================================
|
|
}
|
|
GLOBALS "adprgb000.4gl"
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL ARG_VAL(1) RETURNING usuarios
|
|
CALL ARG_VAL(2) RETURNING clave
|
|
CALL ARG_VAL(3) RETURNING impresor
|
|
CONNECT to "smarmotech" USER usuarios USING clave
|
|
SELECT a.* INTO p_companias.* FROM companias a
|
|
CALL adprrp001()
|
|
END MAIN
|
|
|
|
FUNCTION adprrp001()
|
|
|
|
DEFINE handler om.SaxDocumentHandler, -- return value from fgl_report_commitCurrentSettings()
|
|
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
|
|
DEFINE chempleados STRING
|
|
|
|
DEFINE list_depto RECORD
|
|
dpto LIKE adtb00033.dpto,
|
|
departamento LIKE adtb00033.departamento,
|
|
nom_dpto LIKE adtb00033.nom_dpto,
|
|
estado_a LIKE adtb00029.estado_a,
|
|
estado_m LIKE adtb00029.estado_m,
|
|
depto_ant LIKE adtb00029.depto_ant
|
|
|
|
END RECORD
|
|
|
|
|
|
OPTIONS
|
|
FORM LINE 8,
|
|
ERROR LINE 23,
|
|
COMMENT LINE 21
|
|
|
|
CLEAR SCREEN
|
|
|
|
OPEN FORM adfmrp038 FROM "adfmrp038"
|
|
DISPLAY FORM adfmrp038
|
|
DISPLAY "adprrp001" AT 4,3 ATTRIBUTE(RED)
|
|
DISPLAY "Listado de Departamentos" AT 6,34 ATTRIBUTE(BLACK)
|
|
|
|
LET tipo_papel = 1
|
|
CALL msgrp000(tipo_papel)
|
|
|
|
CONSTRUCT BY NAME criterio ON a.dpto
|
|
|
|
LET parametro = "D"
|
|
# CALL elijeimpresion(parametro) RETURNING orden,destino,letras.*
|
|
|
|
LET selec =
|
|
" select '1',a.departamento,a.nom_dpto,b.estado_a,b.estado_m, ",
|
|
" b.depto_ant ",
|
|
" from adtb00001 a,adtb00029 b ",
|
|
" where a.departamento = b.departamento AND ",criterio CLIPPED," AND ",
|
|
" a.status_t IS NULL ",
|
|
" order by 1,2"
|
|
|
|
DISPLAY "Buscando Informacion ... Espere Por Favor" AT 19,14
|
|
ATTRIBUTE (REVERSE,BOLD)
|
|
|
|
## AQUI SE PREPARA LA INFORMACION SELECCIONADA
|
|
PREPARE busca FROM selec
|
|
DECLARE accion CURSOR FOR busca
|
|
OPEN accion
|
|
|
|
-- configure report engine; the functions prefixed fgl that are called here are part of the GRW API
|
|
LET r_filename = 'adprrp001.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
|
|
--run the report
|
|
IF handler IS NOT NULL THEN -- report engine was configured ok
|
|
|
|
|
|
START REPORT depto TO XML HANDLER handler
|
|
|
|
WHILE STATUS != NOTFOUND
|
|
FETCH accion INTO list_depto.*
|
|
IF STATUS = NOTFOUND THEN
|
|
EXIT WHILE
|
|
END IF
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
|
|
OUTPUT TO REPORT depto(list_depto.*)
|
|
END WHILE
|
|
FINISH REPORT depto
|
|
|
|
CALL fdestino(destino,archivo,imprime)
|
|
CLEAR SCREEN
|
|
END IF
|
|
END FUNCTION
|
|
|
|
REPORT depto(x)
|
|
DEFINE x RECORD
|
|
dpto LIKE adtb00033.dpto,
|
|
departamento LIKE adtb00033.departamento,
|
|
nom_dpto LIKE adtb00033.nom_dpto,
|
|
estado_a LIKE adtb00029.estado_a,
|
|
estado_m LIKE adtb00029.estado_m,
|
|
depto_ant LIKE adtb00029.depto_ant
|
|
|
|
END RECORD
|
|
|
|
define
|
|
hora char(5),
|
|
l smallint
|
|
|
|
|
|
output
|
|
top margin 0
|
|
bottom margin 3
|
|
left margin 0
|
|
|
|
|
|
|
|
format
|
|
page header
|
|
LET hora = time
|
|
|
|
before group of x.dpto
|
|
|
|
on every row
|
|
PRINTX x.departamento,
|
|
x.nom_dpto,
|
|
x.estado_a,
|
|
x.estado_m,
|
|
x.depto_ant
|
|
|
|
let l = 12
|
|
|
|
on last row
|
|
END REPORT
|