I made on Report class
ACTIVATE REPORT oReport FOR oDbf:PROV == cSigla
why it not run ok ? oDbf:Prov is 2cr as cSigla
- Code: Select all Expand view RUN
Function Report_Comuni(oGrid,oParent,odbf)
local oRep
local nRecno := odbf:Recno()
local nOrder := oDbf:OrdSetFocus()
local oFont3, oFont2, oFont1,oFont4
local cFooter := "footers"
local cSigla:="TE"
oDbf:setorder(3)
oDbf:GoTop()
DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD
DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-10 BOLD ITALIC
REPORT oRep ;
TITLE " ","-","-","Stampa elenco comuni" CENTERED;
FONT oFont3, oFont2, oFont1 ;
HEADER '', oApp():cAppName+oApp():cVersion, oApp():cUser ;
FOOTER cFooter, "Data: "+dtoc(date())+ " Pagina.: "+str(oRep:nPage,3) ;
CAPTION oApp():cAppName+oApp():cVersion PREVIEW
COLUMN TITLE "Comune" DATA oDbf:comune
COLUMN TITLE "Provincia" DATA oDbf:prov
ENDREPORT
oRep:bSkip := { || (oDbf:Skip( 1 )) }
oRep:cellview()
ACTIVATE REPORT oRep for oDbf:prov==cSigla;
ON POSTEND (oRep:Say(1, 'Totale comuni: '+Tran(oRep:nCounter, '@ 999,999'), 1) )
oDbf:OrdSetFocus(nOrder)
oDbf:GoTo(nRecno)
oFont1:End()
oFont2:End()
oFont3:End()
oGrid:Refresh()
oGrid:SetFocus( .t. )
return nil