Rpv reporting tools
Clipper / Harbour example with Rpv Reports software.
This example shows how to prepare a report
using Clipper / Harbour programming language using Rpv Reports.
Prepared by Félix Pablo Grande Ramos.
Spain.
//
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:\rpv\rpvtest.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+ "{e;b=y;$c0} Cliente {t;$c1}
Domicilio {t;b=n;\n;\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 :="{e;$c0} "+ Clientes->NOMBRE+ ;
"{t;$c1}"+ Clientes->DIRECCION + "{t;\n}"+ CRTLF
fwrite(file_id,ctexto)
skip
ENDdo
USE
FCLOSE(file_id)
__RUN("rpv rpvtest.rpv /e")
return nil
//----------------------------------------------------------------------------//
|
Download the the Zip file containing the example by clicking
here
This is the generated file by the program: rpvtest.rpv:
Report_Title=Using RPV
and Clipper/Harbour
Papersize=A4
tm=500
Orientation=1
Spacing=250
$c0=1000
$c1=4000
[Header]
{f=arial;s=8}
{e;b=y;$c0} Cliente {t;$c1} Domicilio {t;b=n;\n;\n}
[Data]
{e;$c0}Mark Harris {t;$c1}Top Street 2255{t;\n}
{e;$c0} Dean Garkis{t;$c1}Miraflores 225{t;\n}
{e;$c0} Joe Legrand{t;$c1}Torres 556{t;\n}
{e;$c0} Tito Banderas{t;$c1}Flores 44{t;\n} |
>>
close this window