Function Print_Browse_Comuni(oBrowse,lPrv,lLandscape)
local oPrn, oFn1, oFn2, oFn3, nRec, cSTit, nPre:=0
local aDes, aHas, nHor, nVer, nRow:=5.5, cForm
loca cFont:="Arial"
local lSelected
local cAlias := oBrowse:cAlias
local nAt := 1
local nSaveRec := ( cAlias )->( RECNO() )
IF len( oBrowse:aSelected) <1
lSelected:=.f.
Endif
oPrn:=PrintBegin("Comuni",.F.,lPrv,,.T.)
DEFINE FONT oFn1 NAME cFont SIZE 0,- 8 OF oPrn
DEFINE FONT oFn2 NAME cFont SIZE 0,- 8 BOLD OF oPrn
DEFINE FONT oFn3 NAME cFont SIZE 0,-11 BOLD OF oPrn
cSTit:="Comuni"
cForm:=""
oPrn:lPrvModal:=.T.
IF(!lLandscape,oPrn:SetPortrait(),oPrn:SetLandScape())
nHor:=oPrn:nHorzSize()
nVer:=oPrn:nVertSize()
CursorWait()
PageBegin()
// Title_WIN(oPrn,nHor,nVer,oFn1,oFn2,oFn3,cSTit,1,.F.,cForm)
oPrn:CmSay(4.7, 2.5,"CAP",oFn1)
oPrn:CmSay(4.7,12.0,"CITTA'" ,oFn1,,,,2)
oPrn:CmSay(4.7,14.5,"PROVINCIA" ,oFn1,,,,1)
IF lSelected
do while nAt <= oBrowse:aSelected
( cAlias )->( DBGOTO( oBrowse:aSelected( nAt ) ) )
// PRINT (cAlias)->fields the way you want
oPrn:CmSay(nRow, 2.5, (cAlias)->Cap,oFn1,9.0)
oPrn:CmSay(nRow,12.0, (cAlias)->comune,oFn1,,,,2)
oPrn:CmSay(nRow,14.5, (cAlias)->prov,oFn1,,,,1)
nRow+=0.4
nPre++
IF nRow>=25.5
PageEnd()
PageBegin()
//Title_WIN(oPrn,nHor,nVer,oFn1,oFn2,oFn3,cSTit,1,.F.,cForm)
oPrn:CmSay(4.7, 2.5,"CAP",oFn1)
oPrn:CmSay(4.7,12.0,"CITTA'" ,oFn1,,,,2)
oPrn:CmSay(4.7,14.5,"PROVINCIA" ,oFn1,,,,1)
nRow:=5.5
ENDIF
nAt++
enddo
( cAlias )->( DBGOTO( nSaveRec ) )
ELSE
do while ! ( cAlias )->( eof())
oPrn:CmSay(nRow, 2.5, (cAlias)->Cap,oFn1,9.0)
oPrn:CmSay(nRow,12.0, (cAlias)->comune,oFn1,,,,2)
oPrn:CmSay(nRow,14.5, (cAlias)->prov,oFn1,,,,1)
nRow+=0.4
nPre++
IF nRow>=25.5
PageEnd()
PageBegin()
// Title_WIN(oPrn,nHor,nVer,oFn1,oFn2,oFn3,cSTit,1,.F.,cForm)
oPrn:CmSay(4.7, 2.5,"CAP",oFn1)
oPrn:CmSay(4.7,12.0,"CITTA'" ,oFn1,,,,2)
oPrn:CmSay(4.7,14.5,"PROVINCIA" ,oFn1,,,,1)
nRow:=5.5
ENDIF
( cAlias )->( dbskip())
enddo
Endif
aDes:=oPrn:Cmtr2Pix(nRow+0.4, 1.5)
aHas:=oPrn:Cmtr2Pix(nRow+0.4,19.5)
oPrn:Line(aDes[1],aDes[2],aHas[1],aHas[2])
oPrn:CmSay(nRow+=0.5,10.5,Tran(nPre,"9,999")+" Comune(i)",oFn1,,,,2)
aDes:=oPrn:Cmtr2Pix(nRow+0.4, 1.5)
aHas:=oPrn:Cmtr2Pix(nRow+0.4,19.5)
oPrn:Line(aDes[1],aDes[2],aHas[1],aHas[2])
PageEnd()
oFn1:End(); oFn2:End(); oFn3:End()
PrintEnd()
return nil