Visual FoxPro.NET - reporte

   
Vista:

reporte

Publicado por hugo hugobarros2766@hotmail.com (4 intervenciones) el 30/03/2014 18:09:18
AYUDA PORFA AUXILIO TENGO ESTE FORM ME GENERA DOS TEXTBOX COMO IDENTIFICO LAS VARIALES PARA
FILSTRALOS CON SET FILTER TO COD_CTA NO SE COMO NO ME RECONECE NADA AYUDA




public oMain
oMain = CREATEOBJECT('main') && open main form
oMain.visible = .t.

create CURSOR tmpcue(cod_cta c(10), nom_cta c(40),cuenta_bce c(1),cuenta_pg c(1))
index on alltrim(cod_cta) tag xxxcod1
index on alltrim(upper(nom_cta)) tag xxxcod2
sele tmpcue
SET DELE ON
*!* do lockfile
appen from cuentas
*!* unlock

sele tmpcue
index on alltrim(cod_cta) tag tmpcue
go top
SET DELE ON


**************************************************
*-- Class: main
*-- ParentClass: form
*-- BaseClass: form
*
DEFINE CLASS main AS form

_SCREEN.WINDOWSTATE=0
_SCREEN.SHOWWINDOW=2

Top = 320
Left = 320
Height = 262
Width = 500
DoCreate = .T.
Caption = "Main"
Name = "main"
opform = .F.

ADD OBJECT MiLabel1 AS LABEL WITH ;
LEFT = 24, TOP = 24, AUTOSIZE = .T., ;
NAME = "MiLabel1", CAPTION = "CODIGO INICIAL:"

ADD OBJECT mitext1 AS TEXTBOX WITH ;
LEFT = 122, TOP = 14, HEIGHT = 48, WIDTH = 85, ;
NAME = 'text1', VALUE=SPAC(10)


ADD OBJECT MiLabel2 AS LABEL WITH ;
LEFT = 24, TOP = 42, AUTOSIZE = .T., ;
NAME = "MiLabel2", CAPTION = "CODIGO FINAL :"

ADD OBJECT mitext2 AS TEXTBOX WITH ;
LEFT = 122, TOP = 42, HEIGHT = 28, WIDTH = 85, ;
NAME = 'text2', VALUE=SPAC(10)



ADD OBJECT command1 AS commandbutton WITH ;
Top = 24, ;
Left = 300, ;
Height = 50, ;
Width = 157, ;
Caption = "Show Print Preview", ;
Name = "Command1"

ADD OBJECT command2 AS commandbutton WITH ;
Top = 84, ;
Left = 300, ;
Height = 50, ;
Width = 157, ;
Caption = "IMPRESORA", ;
Name = "Command2"

ADD OBJECT command3 AS commandbutton WITH ;
Top = 144, ;
Left = 300, ;
Height = 50, ;
Width = 157, ;
Caption = "EXCEL", ;
Name = "Command3"

ADD OBJECT command4 AS commandbutton WITH ;
Top = 204, ;
Left = 300, ;
Height = 50, ;
Width = 157, ;
Caption = "SALIR", ;
Name = "Command4"

PROCEDURE command1.Click
oPForm = CREATEOBJECT('printpreview')
oPform.visible = .t. && open printpreview form

STORE DATE() TO WFEC_SYS
STORE " " TO NOMEMPRESA
create CURSOR tmpcue(cod_cta c(10), nom_cta c(40),cuenta_bce c(1),cuenta_pg c(1))
index on alltrim(cod_cta) tag xxxcod1
index on alltrim(upper(nom_cta)) tag xxxcod2
sele tmpcue
SET DELE ON
*!* do lockfile
appen from cuentas
*!* unlock
sele tmpcue
index on alltrim(cod_cta) tag tmpcue
go top
SET DELE ON

* SET FILTER TO COD_CTA= VARIABLE PERO CUAL NO ME LA COJE
* GO TOP


REPORT FORM INFOPUC.FRX PREVIEW WINDOW printpreview IN WINDOW printpreview
ENDPROC

PROCEDURE command2.Click
STORE DATE() TO WFEC_SYS
STORE " " TO NOMEMPRESA
*!* SET FILTER TO ALLTRIM(COD_CTA) >= ALLTRIM(M.CODIGO1) .AND. ALLTRIM(COD_CTA) <= ALLTRIM(XCOD2)
*!* GO TOP
REPORT FORM INFOPUC.FRX TO PRINT PROMPT
ENDPROC
******************
*** EXCEL
******************
PROCEDURE command3.Click
SET FILTER TO COD_CTA=M.CODIGO1
GO TOP
LError = ON('error')
ON ERROR xlapp = NULL
xlapp = GETOBJECT('Excel Application')
ON ERROR &LError
IF ISNULL(xlapp)
xlapp = CREATEOBJECT('Excel.Application')
ENDIF

WITH xlapp
.VISIBLE = 'True'
.DisplayAlerts = 'False'
.Workbooks.ADD()
ENDWITH

xlsheet = xlapp.ActiveSheet
WITH xlsheet
.COLUMNS("A:A").ColumnWidth = 15.00
.COLUMNS("B:B").ColumnWidth = 15.00
.COLUMNS("C:C").ColumnWidth = 15.00
.COLUMNS("D:D").ColumnWidth = 15.00
ENDWITH
Fila = 1
xlsheet.Cells(Fila,1).Value = 'Plan Unico de Cuentas '
WITH xlsheet.Range("A1:B1")
.Font.Name = "Corbel" &&Formatos&&
.Font.Bold = 'True'
.Font.Size = '14'
.WrapText = 'False'
.Merge
ENDWITH
WITH xlsheet.Range("A3:A8")
.Font.Bold = 'True'
ENDWITH
Fila = Fila + 2
xlsheet.Cells(Fila,2).Value = "Cuenta" &&Encabezados&&
xlsheet.Cells(Fila,3).Value = "Nombre de la Cuenta"
xlsheet.Cells(Fila,4).Value = "Bce"
xlsheet.Cells(Fila,5).Value = "Pg"
*!* xlsheet.Cells(Fila,6).Value = "Días"
*!* xlsheet.Cells(Fila,7).Value = "Días 1 a 15"
*!* xlsheet.Cells(Fila,8).Value = "Días 16 a 30"
*!* xlsheet.Cells(Fila,9).Value = "Días 31 a 60"
*!* xlsheet.Cells(Fila,10).Value = "Días 90"


Fila = Fila + 1
WITH xlsheet.Range("A10:C10")
.Font.Bold = 'True'
ENDWITH
Select tmpcue &&Seleccionamos la tabla&&
Scan
xlsheet.Cells(Fila,2).Value = cod_cta
xlsheet.Cells(Fila,3).Value = nom_cta
xlsheet.Cells(Fila,4).Value = cuenta_bce
xlsheet.Cells(Fila,5).Value = cuenta_pg
*!* xlsheet.Cells(Fila,6).Value = tmphu2.dias
*!* xlsheet.Cells(Fila,7).Value = tmphu2.dias_30
*!* xlsheet.Cells(Fila,8).Value = tmphu2.dias_60
*!* xlsheet.Cells(Fila,9).Value = tmphu2.dias_90
*!* xlsheet.Cells(Fila,10).Value = tmphu2.dias_120


Fila = Fila + 1
endscan

ENDPROC

PROCEDURE command4.Click
thisform.release
ENDPROC

ENDDEFINE
*
*-- EndDefine: main
**************************************************

DEFINE CLASS printpreview AS form

ScaleMode = 3
Top = 0
Left = 0
Height = 700
Width = 1100
ShowWindow = 2
DoCreate = .T.
Caption = "Print Preview Window"
Movable = .T.
TitleBar = 0
WindowState = 0
SizeBox = .F.
Name = "printpreview"

ENDDEFINE
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder