cio' che chiamo asel ( array di record selezionati) xbrowse in automatico lo chiama aselected potrebbe funzionare ?
Code: Select all
STAT FUNC Relacion(n)
LOCAL oPrn, oFn1, oFn2, oFn3, cSTit
LOCAL aDes, aHas, nHor,nRow,cForm
LOCAL nRec ,lPrv:=.t.
cSTit:="ELENCO GENERALE SOCI AL "+cf(Date())+" "+ n
cSTit:=Alltrim(cSTit)
nRec:=(oDCli)->(Recno())
oPrn:=PrintBegin("Elenco Soci...",.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
cForm:=Get_Form("101")
* oPrn:SetPortrait() //verticale
oPrn:SetLandscape() //verticale
nHor:=oPrn:nHorzSize()
nVer:=oPrn:nVertSize()
nRow:=4.9
PageBegin()
CursorWait()
Title_WIN(oPrn,nHor,nVer,oFn1,oFn2,oFn3,cSTit,1,.T.,cForm)
oPrn:CmSay(4.2, 1.5,"NUM",oFn1,,,,2)
oPrn:CmSay(4.2, 2.4,"A",oFn1,,,,2)
oPrn:CmSay(4.2, 2.7,"T",oFn1,,,,2)
oPrn:CmSay(4.2, 3.0,"NOMINATIVO",oFn1)
oPrn:CmSay(4.2, 7.0,"TESSERA",oFn1)
oPrn:CmSay(4.2, 8.5,"NASCITA",oFn1)
oPrn:CmSay(4.2,10.6,"TELEFONI",oFn1)
oPrn:CmSay(4.2,15.5,"INDIRIZZO",oFn1)
oPrn:CmSay(4.2,20.5,"LOCALITA'",oFn1)
oPrn:CmSay(4.2,22.5,"CAP",oFn1)
oPrn:CmSay(4.2,23.5,"PROV.",oFn1)
oPrn:CmSay(4.2, 24.5,"CARICA",oFn1)
oPrn:CmSay(4.2, 26.0,"TAGLIA",oFn1)
oPrn:CmSay(4.2, 28.0,"_",oFn1)
nCli:=0
nOpt=1
CursorWait()
(oDCli)->(DbGoTop())
DO WHILE !(oDCli)->(EoF())
IF (nOpt=1 .AND. AScan(oApp:oGrid:aSelected,(oDCli)->NumCli)<>0)
oPrn:CmSay(nRow, 1.5,(oDCli)->NumCli,oFn1,,,,2)
oPrn:CmSay(nRow, 2.4,DaiAtt((oDCli)->Attivita),oFn1,,,,2)
oPrn:CmSay(nRow, 2.8,DaiTipo((oDCli)->Tipo),oFn1,,,,2)
oPrn:CmSay(nRow, 3.0,(oDCli)->Nomeintero,oFn1, 8.7)
oPrn:CmSay(nRow,7.0,(oDCli)->Tessera,oFn1)
oPrn:CmSay(nRow,8.5,cf((oDCli)->Nascita),oFn1)
oPrn:CmSay(nRow,10.6,(oDCli)->Tel1,oFn1)
oPrn:CmSay(nRow,12.6,(oDCli)->Tel2,oFn1)
oPrn:CmSay(nRow,15.5,(oDCli)->Indirizzo,oFn1)
oPrn:CmSay(nRow,20.5,(oDCli)->Localita,oFn1)
oPrn:CmSay(nRow,22.5,(oDCli)->Cap,oFn1)
oPrn:CmSay(nRow,23.5,(oDCli)->Provincia,oFn1)
oPrn:CmSay(nRow,24.5,(oDCli)->Carica,oFn1)
oPrn:CmSay(nRow,26.0,(oDCli)->Taglia,oFn1)
oPrn:CmSay(nRow,28.0,(oDCli)->Sesso,oFn1)
nCli++
nRow+=0.4
IF nRow>=25.5
PageEnd()
PageBegin()
Title_WIN(oPrn,nHor,nVer,oFn1,oFn2,oFn3,cSTit,1,.F.,cForm)
oPrn:CmSay(4.2, 2.0,"NUM",oFn1,,,,2)
oPrn:CmSay(4.2, 2.7,"T",oFn1,,,,2)
oPrn:CmSay(4.2, 3.0,"NOMINATIVO",oFn1)
oPrn:CmSay(4.2, 7.0,"TESSERA",oFn1)
oPrn:CmSay(4.2, 8.5,"NASCITA",oFn1)
oPrn:CmSay(4.2,10.6,"TELEFONI",oFn1)
oPrn:CmSay(4.2,15.5,"INDIRIZZO",oFn1)
oPrn:CmSay(4.2,20.5,"LOCALITA'",oFn1)
oPrn:CmSay(4.2,22.5,"CAP",oFn1)
oPrn:CmSay(4.2,23.5,"PROV.",oFn1)
oPrn:CmSay(4.2, 24.5,"CARICA",oFn1)
oPrn:CmSay(4.2, 26.0,"TAGLIA",oFn1)
oPrn:CmSay(4.2, 28.0,"_",oFn1)
nRow:=4.9
ENDIF
ENDIF
(oDCli)->(DbSkip())
ENDDO
aDes:=oPrn:Cmtr2Pix(nRow+0.3, 1.0)
aHas:=oPrn:Cmtr2Pix(nRow+0.3,29.0)
oPrn:Line(aDes[1],aDes[2],aHas[1],aHas[2])
nRow+=.5
oPrn:CmSay(nRow,10.5, TRAN(nCli,"9999")+" Socio(i) in archivio",oFn1,,,,2)
aDes:=oPrn:Cmtr2Pix(nRow+0.4, 1.0)
aHas:=oPrn:Cmtr2Pix(nRow+0.4,29.0)
oPrn:Line(aDes[1],aDes[2],aHas[1],aHas[2])
nRow+=.5
oPrn:CmSay(nRow,15.5, " Legenda - Tipo (3# colonna) F = Fondatore O = Ordinario S = Sostenitore A = altro - Attivita' ( 2# colonna) D = Docente A = ATA S = Alunno G = Genitore E = Esterno ",oFn1,,,,2)
PageEnd()
oFn1:End(); oFn2:End(); oFn3:End()
PrintEnd()
(oDCli)->(DbGoTo(nRec))
* oBCli:Refresh()
RETURN (NIL)