5
« en: Sábado 30 de Diciembre de 2006, 21:31 »
****Este codigo cuando manda llamar al reporte no hace todas las restriciones ***
*** ustedes cren que sea***
PUBLIC Filtro, cPeriodo
Filtro = ''
cPeriodo = ''
STORE .F. to FilFef, FilFeD,FilFeP
select gyma_a01
SET ORDER TO NOCXP
STORE SPACE(1) TO FiltroF, FiltroD, FiltroP
IF !EMPTY(Thisform.Text2.Value) .and. !EMPTY(Thisform.Text3.Value)
FiltroF = "BETWEEN(gyma_a01.nocar, allt(Thisform.Text2.Value), allt(Thisform.Text3.Value))"
FilFeF = .T.
ENDIF
IF !EMPTY(Thisform.Text4.Value) .and. !EMPTY(Thisform.Text8.Value)
FiltroD = "BETWEEN(gyma_a01.fecha, Thisform.Text4.Value, Thisform.Text8.Value)"
FilFeD = .T.
cPeriodo = "Del: " + DTOC(Thisform.Text4.Value) + " al: " + DTOC(Thisform.Text8.Value)
ENDIF
IF !EMPTY(Thisform.Text1.Value) .and. !EMPTY(Thisform.Text5.Value)
FiltroP = "BETWEEN(gyma_a01.Nocxp, allt(Thisform.Text1.Value),allt(Thisform.Text5.Value))"
FilFeP= .T.
ENDIF
IF FilFeF
Filtro = ALLTRIM(FILTROF)
ENDIF
IF FilFeD AND !EMPTY(Filtro)
Filtro = Filtro + " .and. " + ALLTRIM(FILTROD)
ELSE
Filtro = ALLTRIM(FiltroD)
ENDIF
IF FilFeP AND !EMPTY(Filtro)
Filtro = Filtro + " .and. " + ALLTRIM(FILTROP)
ELSE
Filtro = ALLTRIM(FiltroD)
Endif
SET FILTER TO &FILTRO
GO top
do case
case thisform.optiongroup1.value=1
report form f:\gimnasio\informes\gyminfabo preview
case thisform.optiongroup1.value=2
report form f:\gimnasio\informes\gyminfabo to print prompt noconsole
case thisform.optiongroup1.value=3
delete file c:\Abonos.xls
copy to c:\Abonos.xls TYPE XL5
=Messagebox('Archivo c:\Abonos.xls Creado',48,'Información')
endcase
thisformset.limpia()