- Code: Select all Expand view
- #include "fivewin.ch"
#include "report.ch"
REQUEST DBFCDX
STATIC oReport
Function test()
RDDSetDefault( 'DBFCDX' )
SET DATE FORMAT "dd/mm/yyyy"
SET DATE ITALIAN
SET CENTURY ON
SET EPOCH TO ( YEAR( DATE() ) - 50 )
TRepTariffe():New():Attivare()
return nil
//-------------------------------------------------//
CLASS TRepTariffe
DATA cPath init cFilePath(GetModuleFileName( GetInstance() )) + "Data\"
DATA oReport
DATA oTariffeReport
DATA oFont
METHOD New() CONSTRUCTOR
METHOD Attivare()
END CLASS
METHOD New() CLASS TRepTariffe
::oTariffeReport:= TDatabase():Open( , ::cPath+"TARIFFE", "DBFCDX", .t. )
::oTariffeReport:setorder(1)
/*
::oTariffeReport:Exec( < ||
SET FILTER TO FIELD->IDLISTINO = strzero(nListino,2)
return nil
> )
*/
// xbrowser ::oTariffeReport
DEFINE FONT ::oFont NAME "Tahoma" SIZE 0,-10
REPORT ::oReport ;
TITLE "ELENCO TARIFFE" ;
FONT ::oFont ;
HEADER "Data: " + DTOC( DATE() ) ,;
"stabilimento bagno" ,;
"stabilimento bagno" ,;
"1234567890" LEFT ;
FOOTER "Pagina: " + STR( ::oReport:nPage, 3 ) RIGHT ;
PREVIEW
COLUMN TITLE "TIPO " DATA ::oTariffeReport:tipo
COLUMN TITLE "ELEMENTO " DATA ::oTariffeReport:elemento
COLUMN TITLE "SERVIZIO" DATA ::oTariffeReport:servizio
COLUMN TITLE "SETTORE " DATA ::oTariffeReport:settore
COLUMN TITLE "GIORNI" DATA ::oTariffeReport:giorni
COLUMN TITLE "PREZZO " DATA ::oTariffeReport:costo PICTURE "99,999.99" RIGHT SHADOW
END REPORT
RETURN Self
//---------------------------------------------------------------//
METHOD Attivare() CLASS TRepTariffe
::oTariffeReport:GoTop()
::oReport:bSkip := { || ::oTariffeReport:Skip(1) }
::oReport:Cellview()
ACTIVATE REPORT ::oReport WHILE !::oTariffeReport:eof()
::oFont:End()
::oTariffeReport:Close()
RETURN NIL
Now print one page ok and one blank as you can see here