// Author: Felix Pablo Grande Ramos
// Harbour Advantage RDD sample
#include "FiveWin.ch"
#include "ads.ch"
#include "Fileio.ch"
#define CRTLF CHR(13)+ CHR(10)
REQUEST _ADS
//----------------------------------------------------------------------------//
function Main()
local file_id
local ctexto:=""
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
file_id:=FCREATE("c:
pv
pvtest.rpv")
IF file_id < 0
? "No se puede crear el fichero de prueba"
return nil
else
ctexto := "Report_Title=Using RPV and Clipper/Harbour" + CRTLF
ctexto := ctexto + "Papersize=A4" + CRTLF
ctexto := ctexto + "tm=500" + CRTLF
ctexto:=ctexto+ "Orientation=1" + CRTLF
ctexto:=ctexto+ "Spacing=250" +CRTLF
ctexto:=ctexto + "$c0=1000" + CRTLF
ctexto:=ctexto+ "$c1=4000" + CRTLF
ctexto:=ctexto+ "[Header]" +CRTLF
ctexto:=ctexto+ "{f=arial;s=8}" +CRTLF
ctexto:=ctexto+ "{b=y;$c0} Cliente {$c1} Domicilio {b=n}" +CRTLF
ctexto:=ctexto+ "[Data]" + CRTLF
fwrite(file_id,ctexto)
Endif
SET SERVER LOCAL
SET FILETYPE TO NTX
USE Clientes // Open any DBF...
do While !EOF()
ctexto :="{$c0} "+ Clientes->NOMBRE+ ;
"{$c1}"+ Clientes->DIRECCION + "{
}"+ CRTLF
fwrite(file_id,ctexto)
skip
ENDdo
USE
FCLOSE(file_id)
__RUN("rpv rpvtest.rpv /e")
return nil
//----------------------------------------------------------------------------// |