RE:Principiante en Reportes en 4gl
Mira este Pequeño Ejemplo
Es una de las tantas formas que puedes hacer.
database TU_BASE_DE_DATOS_DEBE_IR_AQUI
Globals
define
tecla char(1),
Variable_LlenarNulos,
Variable_Tabla_Registro record
cliente char(10),
nombre char(40)
end record,
cmd char(20)
end globals
main
clear screen
initialize Variable_LlenarNulos.* to null
create temp table tmpdatos
( cliente char(10),
nombre char(40)
);
load from "datos.unl" insert into tmpdatos ;
declare cursor_1 cursor for
select * from tmpdatos
order by cliente
let cmd = "lp -dimpresora "
start report Funcion_Reporte to pipe cmd
foreach cursor_1 into Variable_Tabla_Registro.*
display Variable_Tabla_Registro.cliente," ",
Variable_Tabla_Registro.nombre
output to report Funcion_Reporte(Variable_Tabla_Registro.* )
let Variable_Tabla_Registro.* = Variable_LlenarNulos.*
end foreach
finish report Funcion_Reporte
end main
report Funcion_Reporte( VTR )
Define VTR record
cliente char(10),
nombre char(40)
end record,
line1 char(100)
output
left margin 0
order external by VTR.cliente
format
page header
let line1 = date clipped, 10 spaces, "EMPRESA DE PRUEBA S.A.",10 spaces,
"Pag : ", pageno using "&&"
print column line1
print column 1, "----------------------------------------",
"----------------------------------------",
"------------"
before group of VTR.cliente
print column 1, "----------------------------------------",
"----------------------------------------",
"------------"
on every row
print column 1, VTR.cliente,
column 15, VTR.nombre
after group of VTR.cliente
skip to top of page
on last row
print "Fin Reporte"
end report
Aprovecha Esta Gran Oportunidad Te Invita (RIVAlDO)
http://www.lideresubi.com/informate
Recuerda Entrar como DT-RIVALDO-TUNOMBRE-PAIS
5:00pm colombia, mexico, peru
ver http://www.horariomundial.com
http://www.ubifone.clubcaebiz.net/grabaciones.html
www.cyberoficina.com/rivaldo