You are on page 1of 19

*************************** **Generar FRX Proveedores** ***-------------------- **** *************************** PROCEDURE adpgenerarreporte public oMain oMain = CREATEOBJECT ('main') &&

oMain.visible = .t. oMain.SHOW (2) DEFINE CLASS main AS form FORM&&&&&&&&&&&&&&&&&&&& Height = 280 Width = 410 BACKCOLOR = RGB(255,255,255) BORDERSTYLE = 1 SHOWWINDOW = 1 TITLEBAR = 0 AUTOCENTER = .T. **DoCreate = .T. Caption = "Vista Previa" Name = "main" &&opform = .F. **-------LABELS---------** ************************** ADD OBJECT Label1 AS LABEL WITH ; &&Terra_Inventario&& CAPTION = "Terra_Inventario", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 6, LEFT = 6 ADD OBJECT Label2 AS LABEL WITH ; &&Generar Reporte&& Caption = "Generar Reporte", Fontname = "Calibri", Fontsize = 16, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 22, LEFT = 6 ADD OBJECT Label3 AS LABEL WITH ; &&Ver Reporte&& Caption = "Ver Reporte", FONTNAME = "Arial", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 106, LEFT = 332 ADD OBJECT Label4 AS LABEL WITH ; &&General&& Caption = "General", FONTNAME = "Arial", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 156, LEFT = 333 ADD OBJECT Label5 AS LABEL WITH ; &&Inserte Codigo&& CAPTION = "Inserte Codigo", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 133, LEFT = 95, VISIBLE = .F. ADD OBJECT Label6 AS LABEL WITH ; &&Inserte Nombre proveedor&& CAPTION = "Inserte Nombre", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 89, LEFT = 158, VISIBLE = .F. ADD OBJECT Label7 AS LABEL WITH ; &&Inserte Fecha&& CAPTION = "Inserte Fecha", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 89, LEFT = 177, VISIBLE = .F. ADD OBJECT Label8 AS LABEL WITH ; &&Desde&& CAPTION = "Desde", FONTNAME = "Arial", FONTSIZE = 8, VISIBLE = .F., ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 134, LEFT = 31 ADD OBJECT Label9 AS LABEL WITH ; &&Hasta&& CAPTION = "Hasta", FONTNAME = "Arial", FONTSIZE = 8, VISIBLE = .F., ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 164, LEFT = 34 ADD OBJECT Label10 AS LABEL WITH ; &&Parametros&& CAPTION = "Parametros", FONTNAME = "Calibri", FONTSIZE = 9, ; && open main form

&&&&&&&&&&&START DEFINE CLASS AS

AUTOSIZE = .T., BACKSTYLE = 0, TOP = 78, LEFT = 31 ADD OBJECT Label11 AS LABEL WITH ; &&Generar Reporte por : Codigo&& CAPTION = "Parametro seleccionado : Reporte por Codigo", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 218, LEFT = 14, VISIBLE = .F. ADD OBJECT Label12 AS LABEL WITH ; &&Generar Reporte por : Nombre&& CAPTION = "Parametro seleccionado : Reporte por R.U.C", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 218, LEFT = 14, VISIBLE = .F. ADD OBJECT Label13 AS LABEL WITH ; &&Generar Reporte por : Fecha&& CAPTION = "Parametro seleccionado : Reporte por Fecha", FONTNAME = ; "Calibri", FONTSIZE = 8, AUTOSIZE = .T., BACKSTYLE = 0, TOP = 218, LEFT = 14, VISIBLE = .F. ADD OBJECT Label14 AS LABEL WITH ; &&Parametro seleccionado ; Ninguno&& CAPTION = "Parametro selecci onado : *** Ninguno", FONTNAME = ; "Calibri", FONTSIZE = 8, AUTOSIZE = .T., BACKSTYLE = 0, TOP = 218, LEFT = 14 ADD OBJECT Label15 AS LABEL WITH ; &&Salir&& Caption = "Salir", FONTNAME = "Arial", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 223, LEFT = 332, VISIBLE = .T. ADD OBJECT Label16 AS LABEL WITH ; CAPTION = "Operador", FONTNAME = "Calibri", FONTSIZE = 9, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 78, LEFT = 150, VISIBLE = .T. ADD OBJECT Label17 AS LABEL WITH ; CAPTION = "Seleccione parametro y operador", FONTNAME = "Calibri", FONTSIZE = 11, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 145, LEFT = 12, VISIBLE = .T. ADD OBJECT Label18 AS LABEL WITH ; &&Hasta&& CAPTION = "Dato", FONTNAME = "Arial", FONTSIZE = 8, VISIBLE = .F., ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 149, LEFT = 30 ADD OBJECT Label19 AS LABEL WITH ; &&Generar Reporte por : Nombre&& CAPTION = "Parametro seleccionado : Reporte por Nombre", FONTNAME = "Calibri", FONTSIZE = 8, ; AUTOSIZE = .T., BACKSTYLE = 0, TOP = 218, LEFT = 14, VISIBLE = .F. **--------LINES---------** ************************** ADD OBJECT Line1 AS LINE WITH ; &&________&& WIDTH = 77, HEIGHT = 0, TOP = 20, LEFT = 7, BORDERCOLOR = RGB (100,100,100) ADD OBJECT Line2 AS LINE WITH ; &&________&& WIDTH = 0, HEIGHT = 214, TOP = 33, LEFT = 280, BORDERCOLOR = RGB (192,192,192) ADD OBJECT Line3 AS LINE WITH ; &&________&& WIDTH = 60, HEIGHT = 0, TOP = 193, LEFT = 280, BORDERCOLOR = RGB (192,192,192) ADD OBJECT Line4 AS LINE WITH ; &&____Text1&& WIDTH = 0, HEIGHT = 22, TOP = 130, LEFT = 67, BORDERCOLOR = RGB (192,192,192), BORDERWIDTH = 2, ; VISIBLE = .F. ADD OBJECT Line5 AS LINE WITH ; &&____Text2&& WIDTH = 0, HEIGHT = 22, TOP = 160, LEFT = 67, BORDERCOLOR = RGB (192,192,192), BORDERWIDTH = 2, ; VISIBLE = .F. ADD OBJECT Line6 AS LINE WITH ; &&________&& WIDTH = 245, HEIGHT = 0, TOP = 193, LEFT = 12, BORDERCOLOR = RGB (192,192,192) ADD OBJECT Line7 AS LINE WITH ; &&________&&

WIDTH = 60, HEIGHT = 0, TOP = 71, LEFT = 280, BORDERCOLOR = RGB (192,192,192) ADD OBJECT Line8 AS LINE WITH ; &&____Text2&& WIDTH = 0, HEIGHT = 22, TOP = 141, LEFT = 63, BORDERCOLOR = RGB (192,192,192), BORDERWIDTH = 2, ; VISIBLE = .F. ADD OBJECT Line9 AS LINE WITH ; WIDTH = 245, HEIGHT = 0, TOP = 71, LEFT = 12, BORDERCOLOR = RGB(192,192,192) **--------SHAPES--------** ************************** ADD OBJECT Shape1 AS SHAPE WITH ; &&Shape1&& WIDTH = 8, HEIGHT = 8, BORDERSTYLE = 0, BACKCOLOR = RGB(155,45,42), TOP = 46, LEFT = 8 ADD OBJECT Shape2 AS SHAPE WITH ; &&Shape2&& WIDTH = 8, HEIGHT = 8, BORDERSTYLE = 0, BACKCOLOR = RGB(44,93,152), TOP = 46, LEFT = 19 ADD OBJECT Shape3 AS SHAPE WITH ; &&Shape3&& WIDTH = 8, HEIGHT = 8, BORDERSTYLE = 0, BACKCOLOR = RGB(225,128,47), TOP = 46, LEFT = 30 ADD OBJECT Shape4 AS SHAPE WITH ; &&Shape4&& WIDTH = 8, HEIGHT = 8, BORDERSTYLE = 0, BACKCOLOR = RGB(118,149,53), TOP =46 , LEFT = 41 ADD OBJECT Shape5 AS SHAPE WITH ; &&Shape5--Ver Reporte&& WIDTH = 103, HEIGHT = 39, BACKSTYLE = 0, BORDERCOLOR = RGB(100,100,100), TOP =93 , LEFT = 293, VISIBLE = .F. ADD OBJECT Shape6 AS SHAPE WITH ; &&Shape--General&& WIDTH = 103, HEIGHT = 39, BACKSTYLE = 0, BORDERCOLOR = RGB(100,100,100), TOP =143 , LEFT = 293, VISIBLE = .F. ADD OBJECT Shape7 AS SHAPE WITH ; &&Shape--Salir&& WIDTH = 103, HEIGHT = 39, BACKSTYLE = 0, BORDERCOLOR = RGB(100,100,100), TOP =210 , LEFT = 293, VISIBLE = .F. **--------IMAGES--------** ************************** ADD OBJECT Image1 AS IMAGE WITH ; &&Image1&& PICTURE = "C:\Terra_ Proyect 1 -VFP 9.0\GRAPHICS\Ver.ico", ; VISIBLE = .T., TOP = 96, LEFT = 295, BACKSTYLE = 0, MOUSEPOINTER = 15, TABINDEX = 3 ADD OBJECT Image2 AS IMAGE WITH ; &&Imagen2&& PICTURE = "C:\Terra_ Proyect 1 -VFP 9.0\GRAPHICS\General.ico", ; VISIBLE = .T., TOP = 146, LEFT = 295, BACKSTYLE = 0, MOUSEPOINTER = 15 ADD OBJECT Image3 AS IMAGE WITH ; &&Imagen3&& PICTURE = "C:\Terra_ Proyect 1 -VFP 9.0\GRAPHICS\Salir.ico", ; VISIBLE = .T., TOP = 213, LEFT = 295, BACKSTYLE = 0, MOUSEPOINTER = 15 **--------TEXTS---------** ************************** ADD OBJECT text1 AS Textbox with ; &&Text1&& Alignment = 2, TOP = 130, LEFT = 73, HEIGHT = 23, WIDTH = 170, NAME = "Text1", ; VISIBLE = .F., ENABLED = .F., TABINDEX = 1, DISABLEDBACKCOLOR = RGB(255,255,255) ADD OBJECT text2 AS Textbox with ; &&Text2&&

ALIGNMENT = 2, TOP = 160, LEFT = 73, HEIGHT = 23, WIDTH = 170, NAME = "Text2", ; VISIBLE = .F., ENABLED = .F., TABINDEX = 2, DISABLEDBACKCOLOR = RGB(255,255,255) **------COMBOBOXES ------** ************************** ADD OBJECT Combo1 AS COMBOBOX WITH ; &&Combo1&& ALIGNMENT = 0, TOP = 96, LEFT = 31, HEIGHT = 23, WIDTH = 97, VISIBLE = .T., ; TABSTOP = .F., NAME = "Combo1" ADD OBJECT Combo2 AS COMBOBOX WI TH ; &&Combo2&& ALIGNMENT = 0, TOP = 96, LEFT = 150, HEIGHT = 23, WIDTH = 93, VISIBLE = .T., ; TABSTOP = .F., NAME = "Combo2" *!*----------------------- *!* PROCEDURE INIT &&Ubicar enforque de puntero&& THISFORM.Text1.SETFOCUS () *--* **Propiedades de ComboBoxes&& THISFORM.Combo1.FONTNAME = "Calibri" THISFORM.Combo1.FONTSIZE = 9 THISFORM.Combo2.FONTNAME = "Calibri" THISFORM.Combo2.FONTSIZE = 9 THISFORM.Combo1.ROWSOURCE = "Codigo,Nombre,R.U.C,Fecha" THISFORM.Combo1.ROWSOURCETYPE = 1 THISFORM.Combo1.Value = 0 THISFORM.Combo2.ROWSOURCE = "Igual,Contiene,Distinto,Entre,Mayor,Menor,Mayor Igual,Menor Igual" THISFORM.Combo2.ROWSOURCETYPE = 1 THISFORM.Combo2.Value = 0 ENDPROC *!*----------------------- *!* **************** ****************** **-Shapes.Visible in Image1,2,3 -** *-------------------------------- * PROCEDURE Image1.MouseMove LPARAMETERS nButton, nShift, nXCoord, THISFORM.Shape5.Visible = .T. ENDPROC PROCEDURE Image1.MouseLeave LPARAMETERS nButton, nShift, nXCoord, THISFORM.Shape5.Visible = .F. ENDPROC *!* PROCEDURE Image2.MouseMove LPARAMETERS nButton, nShift, nXCoord, THISFORM.Shape6.Visible = .T. ENDPROC PROCEDURE Image2.MouseLeave LPARAMETERS nButton, nShift, nXCoord, THISFORM.Shape6.Visible = .F. ENDPROC *!* PROCEDURE Image3.MouseMove LPARAMETERS nButton, nShift, nXCoord, THISFORM.Shape7.Visible = .T. ENDPROC PROCEDURE Image3.MouseLeave

nYCoord

nYCoord

nYCoord

nYCoor d

nYCoord

LPARAMETERS nButton, nShift, nXCoord, nYCoord THISFORM.Shape7.Visible = .F. ENDPROC ************************************** **----Comboboxes.InteractiveChange ---* **--Combo1.InteractiveChange --** PROCEDURE Combo1.InteractiveChange &&Habilitamos Text1 -Text2&& IF THISFORM .Combo1.ListIndex <> 0 AND THISFORM.Combo2.ListIndex <> 0 THISFORM.Text1.Enabled = .T. THISFORM.Text2.Enabled = .T. ENDIF &&Cambio InputMask - Format en Combo1.ListIndex = 1,2,3&& DO CASE CASE THISFORM .Combo1.ListIndex = 1 &&Combo1.ListIndex = Codigo ("999")&& THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text1.InputMask = "99999999999999999999999999" THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text1.Format = "9" THISFORM.Text2.Format = "9" CASE THISFORM .Combo1.ListIndex = 2 &&Combo1.ListIndex = Nombre ("U")&& THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text1.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Text1.Format = "x" THISFORM.Text1.MaxLength = 35 THISFORM.Text2.MaxLength = 35 CASE THISFORM .Combo1.ListIndex = 3 &&Combo1.ListIndex = R.U.C ("999")&& THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text1.InputMask = "99999999999999999999999999" THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text1.Format = "9" THISFORM.Text2.Format = "9" CASE THISFORM .Combo1.ListIndex = 4 &&Combo1.ListIndex = Fecha ("99/99/9999")&& THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text1.InputMask = "99/99/9999" THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Text1.Format = "D" ENDCASE THISFORM.Combo2.InteractiveChange ENDPROC ******************************** **--Combo2.InteractiveChange --** &&Aplicar filtros&&

**---------------------------- ** PROCEDURE Combo2.InteractiveChange &&Habilitamos Text1 -Text2&& IF THISFORM .Combo2.ListIndex > 0 AND THISFORM.Combo2.ListIndex > 0 THISFORM.Text1.Enabled = .T. THISFORM.Text2.Enabled = .T. ENDIF ******************************************************* **Filtros de Generacion: Codigo, Nombre, R.U.C, Fecha** **--------------------------------------------------- ** DO CASE CASE THISFORM .Combo1.ListIndex = 1 &&Parametros.Codigo&& THISFORM.Label11.Visible = .T. &&Label.Parametro seleccionado : Reporte por Codigo&& THISFORM.Label12.Visible = .F. &&Label.Parametro seleccionado : Reporte por R.U.C&& THISFORM.Label13.Visible = .F. &&Label.Parametro seleccionado : Reporte por Fecha&& THISFORM.Label14.Visible = .F. &&Label.Parametro seleccionado : *** Ninguno&& THISFORM.Label17.Visible = .F. &&Label.Seleccione Parametro y Operador&& THISFORM.Label19.Visible = .F. &&Label.Parametro seleccionado : Repor te por Nombre& DO CASE &&Operador.Igual&& CASE THIS.ListIndex = 1 THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO codigoproveedor = VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 2 &&Operador.Contiene&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. THISFORM.Label9.Visible = .F. THISFORM.Label18. Visible = .T. THISFORM.Line4.Visible = .F. THISFORM.Line5.Visible = .T. THISFORM.Line5.Top = 145

THISFORM.Text2.Setfocus SET FILTER TO ALLTRIM (THISFORM.Text2.Value) $ STR(codigoproveedor) CASE THIS.ListIndex = 3 &&Operador.Distinto&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1 && THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO codigoproveedor <> VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 4 &&Operador.Entre&& THISFORM.Text1.Visible = .T. THISFORM.Text2.Visible = .T. THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text2.Top = 160 THISFORM.Text1.InputMask = "99999999999999999999999999" THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text1.Format = "9" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .T. &&Label.Desde&& THISFORM.Label9.Visible = .T. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .T. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 160 THISFORM.Text1.Setfocus SET FILTER TO codigoproveedor => VAL(THISFORM.Text1.Value) AND codigoproveedor =< VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 5 &&Operador.Mayor && THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. THISFORM.Label9.Visible = .F. THISFORM.Label18. Visible = .T. THISFORM.Line4.Visible = .F. THISFORM.Line5.Visible = .T. THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO codigoproveedor > VAL(THISFORM.Text2.Value)

CASE THIS.ListIndex = 6 &&Operador.Menor&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. THISFORM.Label9.Visible = .F. THISFORM.Label18. Visible = .T. THISFORM.Line4.Visible = .F. THISFORM.Line5.Visible = .T. THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO codigoproveedor < VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 7 &&Operador.Mayor -Igual&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. THISFORM.Label9.Visible = .F. THISFORM.Label18. Visible = .T. THISFORM.Line4.Visible = .F. THISFORM.Line5.Visible = .T. THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO codigoproveedor >= VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 8 &&Operador.Menor -Igual&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. THISFORM.Label9.Visible = .F. THISFORM.Label18. Visible = .T. THISFORM.Line4.Visible = .F. THISFORM.Line5.Visible = .T. THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO codigoproveedor <= VAL(THISFORM.Text2.Value) ENDCASE *!* CASE THISFORM .Combo1.ListIndex = 2 &&Parametro.Nombre&& THISFORM.Label11.Visible = .F. &&Label.Parametro seleccionado : Reporte por Codigo&& THISFORM.Label12.Visible = .F. &&Label.Parametro seleccionado : Re porte por R.U.C&&

THISFORM.Label13.Visible seleccionado : Reporte por Fecha&& THISFORM.Label14.Visible seleccionado : *** Ninguno&& THISFORM.Label17.Visible Parametro y Opera dor&& THISFORM.Label19.Visible seleccionado : Reporte por Nombre&

= .F. = .F. = .F. = .T.

&&Label.Parametro &&Label.Parametro &&Label.Seleccione &&Label.Parametro

DO CASE CASE THIS.ListIndex = 1 &&Operador.Igual&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta && THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO UPPER (nombreproveedor) = UPPER(ALLTRIM(THISFORM.Text2.VALUE)) CASE THIS.ListIndex = 2 &&Operador.Contiene THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO UPPER(ALLTRIM(THISFORM.Text2.VALUE)) $ UPPER(nombreproveedor) CASE THIS.ListIndex = 3 &&Operador.Distinto&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145

THISFORM.Text2.Setfocus SET FILTER TO ALLTRIM (nombreproveedor) <> UPPER(ALLTRIM(THISFORM.Text2.Value)) CASE THIS.ListIndex = 4 &&Operador.Entre&& MESSAGEBOX ("El operador 'Entre' no es aplicable al parametro Nombre", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO &&Operador.Mayor&& CASE THIS.ListIndex = 5 MESSAGEBOX ("El operador 'Mayor' no es aplicable al parametro Nombre", 0 + 48, " Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO CASE THIS.ListIndex = 6 &&Operador.Menor&& MESSAGEBOX ("El operador 'Menor' no es aplicable al parametro Nombre", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO &&Operador.Mayor -Igual&& CASE THIS.ListIndex = 7

MESSAGEBOX ("El operador 'Mayor Igual' no es aplicable al parametro Nombre", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO CASE THIS.ListIndex = 8 &&Operador.Menor -Igual&& MESSAGEBOX ("El operador 'Menor Igual' no es aplicable al parametro Nombre", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" THISFORM.Text2.Format = "x" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO ENDCASE *!* CASE THISFORM .Combo1.ListIndex = 3 &&Parametro.RUC&& THISFORM.Label11.Visible = .F. &&Label.Parametro seleccionado : Reporte por Codigo&& THISFORM.Label12.Visible = .T. &&Label.Parametro seleccionado : Reporte por R.U.C&& THISFORM.Label13.Visible = .F. &&Label.Parametro seleccionado : Reporte por Fecha&& THISFORM.Label14.Visible = .F. &&Label.Parametro seleccionado : *** Ninguno&& THISFORM.Label17.Visible = .F. &&Label.Seleccione Parametro y Operador&& THISFORM.Label19.Visible = .F. &&Label.Parametro seleccionado : Reporte por Nombre& DO CASE &&Operador.Igual&& CASE THIS.ListIndex = 1 THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145

THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO ruc = VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 2 &&Operador.Contiene&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. THISFORM.Label9.Visible = .F. THISFORM.Label18. Visible = .T. THISFORM.Line4.Visible = .F. THISFORM.Line5.Visible = .T. THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO ALLTRIM (THISFORM.Text2.Value) $ STR(ruc) CASE THIS.ListIndex = 3 &&Operador.Distinto&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato && THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO ruc <> VAL(THISFORM.Text2.Value) CASE THIS.ListIndex = 4 &&Operador.Entre&& MESSAGEBOX ("El operador 'Entre' no es aplicable para el parametro R.U.C", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text2.Top = 160 THISFORM.Text1.InputMask = "99999999999999999999999999" THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text1.Format = "9"

THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 160 SET FILTER TO CASE THIS.ListIndex = 5 &&Operador.Mayor&& MESSAGEBOX ("El operador 'Mayor' no es aplicable para el parametro R.U.C", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO &&Operador.Menor& CASE THIS.ListIndex = 6 MESSAGEBOX ("El operador 'Menor' no es aplicable para el parametro R.U.C", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta && THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO &&Operador.Mayor -Igual&& CASE THIS.ListIndex = 7 MESSAGEBOX ("El operador 'Mayor Igual' no es aplicable para el parametro R.U.C", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&&

THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO &&Operador.Menor -Igual&& CASE THIS.ListIndex = 8 MESSAGEBOX ("El operador 'Menor Igual' no es aplicable para el parametro R.U.C", 0 + 48, "Error - (Operador no aplicable a la generacion)") THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .F. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99999999999999999999999999" THISFORM.Text2.Format = "9" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato && THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .F. &&Line.Text2&& THISFORM.Line5.Top = 145 SET FILTER TO ENDCASE *!* CASE THISFORM .Combo1.ListIndex = 4 &&Parametro.Fecha&& THISFORM.Label11.Visible = .F. &&Label.Parametro seleccionado : Reporte por Codigo&& THISFORM.Label12.Visible = .F. &&Label.Parametro seleccionado : Reporte por R.U.C&& THISFORM.Label13.Visible = .T. &&Label.Parametro seleccionado : Reporte por Fecha&& THISFORM.Label14.Visible = .F. &&Label.Parametro seleccionado : *** Ninguno&& THISFORM.Label17.Visible = .F. &&Label.Seleccione Parametro y Operador&& THISFORM.Label19.Visible = .F. &&Label.Parametro seleccionado : Reporte por Nombre& DO CASE &&Operador.Igual&& CASE THIS.ListIndex = 1 THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO fecha = CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 2 &&Operador.Contiene&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F.

THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.SETFOCUS SET FILTER TO fecha = CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 3 &&Operador.Distinto&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.SETFOCUS SET FILTER TO fecha <> CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 4 &&Operador.Entre&& THISFORM.Text1.Visible = .T. THISFORM.Text2.Visible = .T. THISFORM.Text1.Value = " " THISFORM.Text2.Value = " " THISFORM.Text2.Top = 160 THISFORM.Text1.InputMask = "99/99/9999" THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text1.Format = "D" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .T. &&Label.Desde&& THISFORM.Label9.Visible = .T. &&Label.Hasta&& THISFORM.Label18. Visible = .F. &&Label.Dato&& THISFORM.Line4.Visible = .T. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 160 THISFORM.Text1.Setfocus SET FILTER TO fecha => CTOD(THISFORM.Text1.Value) AND fecha =< CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 5 &&Operador.Mayor&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&&

THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO fecha > CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 6 &&Operador.Menor&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO fecha < CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 7 &&Operador.Mayor -Igual&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO fecha >= CTOD(THISFORM.Text2.Value) CASE THIS.ListIndex = 8 &&Operador.Menor -Igual&& THISFORM.Text1.Value = "*" THISFORM.Text2.Value = " " THISFORM.Text1.Visible = .F. THISFORM.Text2.Visible = .T. THISFORM.Text2.Top = 145 THISFORM.Text2.InputMask = "99/99/9999" THISFORM.Text2.Format = "D" THISFORM.Label8.Visible = .F. &&Label.Desde&& THISFORM.Label9.Visible = .F. &&Label.Hasta&& THISFORM.Label18. Visible = .T. &&Label.Dato&& THISFORM.Line4.Visible = .F. &&Line.Text1&& THISFORM.Line5.Visible = .T. &&Line.Text2&& THISFORM.Line5.Top = 145 THISFORM.Text2.Setfocus SET FILTER TO fecha <= CTOD(THISFORM.Text2.Value) ENDCASE ENDCASE ENDPROC ********************************************************************* ************************************************** *******************

***************************************** **--Ver reporte - nKeycode = 13 en Txt2** **Llamamos reporte con nkeycode = 13 desde text2**_ PROCEDURE text2.Keypress &&Valid LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode = 13 THISFORM.Image1.Click ENDIF ENDPROC ***************************************** ********************************************* **------------- Ima Ver Reporte ------------- ** ********************************************* PROCEDURE Image1.Click &&Image1.Cl ick&&

&&Si Parametro y Operador = " "&& IF THISFORM .Combo1.ListIndex = 0 AND THISFORM.Combo2.ListIndex = 0 =MESSAGEBOX ("Por favor, seleccione parametro y operador para generacion de reporte.", 48, "Error - (Parametro y operador requeridos)") RETURN .F. ENDIF &&Si Parametro = " "&& IF THISFORM .Combo1.ListIndex = 0 =MESSAGEBOX ("Por favor, seleccione parametro para generacion de reporte.", 48, "Error - (Parametro requerido)") RETURN .F. ENDIF &&Si Operador = " "&& IF THISFORM .Combo2.ListIndex = 0 =MESSAGEBOX ("Por favor, seleccione operador para generacion de reporte.", 48, "Error - (Operador requerido)") RETURN .F. ENDIF &&Si rangos = " "&& IF THISFORM .Combo1.ListIndex > 0 AND THISFORM.Combo2.ListIndex = 3 AND THISFORM.Text1.Value = " " AND THISFORM.Text2.Value = " " =MESSAGEBOX ("Por favor, ingrese rangos para generacion de reporte.", 48, "Error - (Rangos requeridos)") RETURN .F. ENDIF &&Si Rango Inicial = " "&& IF THISFORM .Combo1.ListIndex > 0 AND THISFORM.Combo2.ListIndex = 3 AND THISFORM.Text1.Value = " " =MESSAGEBOX ("Por favor, ingrese rango inicial para generacion de reporte.", 48, "Error - (Rango requerido)") RETURN .F. ENDIF &&Si Rango Final = " "&& IF THISFORM .Combo1.ListIndex > 0 AND THISFORM.Combo2.ListIndex = 3 AND THISFORM.Text2.Value = " "

=MESSAGEBOX ("Por favor, ingrese rango final para generacion de reporte.", 48, "Error - (Rango requerido)") RETURN .F. ENDIF &&Si Rango Inicial > Rango Final&& IF THISFORM .Combo1.ListIndex > 0 AND THISFORM.Combo2.ListIndex = 3 AND THISFORM.Text1.Value > THISFORM.Text2.Value =MESSAGEBOX ("Error al definir rangos de generacion", 48, "Error (Definicion de rangos)") RETURN .F. ENDIF &&Si Dato = " "&& IF THISFORM .Combo1.ListIndex > 0 AND THISFORM.Combo2.ListIndex > 0 AND THISFORM.Text2.Value = " " =MESSAGEBOX ("Por favor, ingrese dato para generacion de reporte.", 48, "Error - (Dato requerido)") RETURN .F. ENDIF *******Crear form vacio de vista previa***** oPForm = CREATEOBJECT ('printpreview') oPform.visible = .t. && open printprevi ew form SELECT proveedores local lnRecord &&Variable para posicionar puntero al salir del form&& lnRecord=recno() **Aplicamos filtro** **SET FILTER TO codigo_producto=>Val(thisform.text1.Value) AND codigo_producto=<Val(thisform.text2.Value) REPORT FORM "proveedores.frx" PREVIEW WINDOW printpreview IN WINDOW printpreview GOTO lnRecord &&dejar puntero de tabla en registro actual y poder desplazar en form padre&& RELEASE lnRecord **SET FILTER TO ENDPROC ********************************************* ********************************************* ************************************** **----------- BTN Ver General --------- * PROCEDURE Image2.Click &&Image.Click &&Label.Inserte Codigo&& &&Label.Inserte RUC&& &&Label.Inserte Fecha&&

THISFORM.Label5.Visible = .F. THISFORM.Label6.Visible = .F. THISFORM.Label7.Visible = .F. THISFORM.Label11. Visible = .F. THISFORM.Label12. Visible = .F. THISFORM.Label13. Visible = .F. THISFORM.Label14. Visible = .T. THISFORM.Text1.Value = " " THISFORM.Text2.Value = " "

*******Crear form vacio de vista previa***** oPForm = CREATEOBJECT ('printpreview') && open printpreview form oPform.visible = .t.

local lnRecord lnRecord= recno()

&&Variable para posicionar puntero al salir del form &&

SELECT proveedores SET FILTER TO REPORT FORM "proveedores.frx" PREVIEW WINDOW printpreview IN WINDOW printpreview GOTO lnRecord &&dejar puntero de tabla en registro actual y poder desplazar en form padre&& RELEASE lnRecord ENDPROC &&ENDDEFINE * *-- EndDefine: main ********************************************** ********************************************** ********************************************** **------------ Btn Salir --------------------- ** ********************************************** PROCEDURE Image3.Click &&Image3.Click SET FILTER TO &&Quitar filtro de tabla&& THISFORM.Release ENDPROC ENDDEFINE &&&&&&&&&&&END DEFINE CLASS AS FORM&&&&&&&&&&&&&&&&&&&&

************************ ****************** **------------------------------------- *** DEFINE CLASS printpreview AS form ScaleMode = 3 Top = 0 Left = 0 Height = 454 Width = 641 ShowWindow = 2 Closable = .T. DoCreate = .T. Caption = "Vista Previa - Reporte de Proveedores" Movable = .T. TitleBar = 0 WindowState = 2 SizeBox = .F. Name = "printpreview" ENDDEFINE ENDPROC **------------------------------------- ** ***********Final de codigo***************

You might also like