wc_tabla = putfile("Guardar como"," ", "xls")
if !empty(wc_tabla) then
LOCAL cErrores, lExcel
cErrores = ON("ERROR")
ON ERROR lExcel = .F.
oExcel = GetObject(,"excel.application")
ON ERROR &cErrores
IF TYPE("oExcel") # 'O'
oExcel = CREATEOBJECT("Excel.Application")
ENDIF
oExcel.VISIBLE = .t. && VISUALIZO EXCEL
oExcel.Workbooks.ADD && PREPARO UN NUEVO TRABAJO DE EXCEL
SELEct cur_busca
GO TOP
nRows = 0
wi_pagina = 1
wi_columnas = fcount()
SCAN
nRows = nRows + 1
FOR nColumn = 1 TO wi_columnas
wc_campo = field(nColumn)
oExcel.Cells(nRows,nColumn) = &wc_campo
NEXT nColumn
wait window 'Hoja :'+str(wi_pagina)+' Renglon :'+str(nRows) nowait
if nRows>64000
IF CONTADOR <= 3
wc_nombre = "Hoja"+alltrim(str(contador))
oExcel.Sheets(wc_nombre).select
contador = contador + 1
else
contador = contador + 1
oExcel.Worksheets.Add &&after:=ActiveSheet
endif
wi_pagina = contador
nRows=1
endif
ENDSCAN
oExcel.VISIBLE = .T. && VISUALIZO EXCEL
oExcel.activeworkbook.saveas(alltrim(wc_tabla), -4143)
oExcel.quit
Release oExcel
oExcel = Null
messagebox("El archivo ha sido generado ",48,gc_letrero)
endif
Mostrando entradas con la etiqueta Fox pro. Mostrar todas las entradas
Mostrando entradas con la etiqueta Fox pro. Mostrar todas las entradas
Fox pro
*Codigo para autocompletar en un Textbox con datos de una tabla.
select tbl_inventario
total = reccount()
if between(nKeyCode, 32, 122)
for x = 1 to total
go x
if upper(subs(tbl_inventario.nombre, 1, this.selstart+ 1)) = ;
upper(subs(this.text, 1, this.selstart)+chr(nKeyCode))
nCurPos = this.selstart + 1
this.Value = tbl_inventario.nombre
this.SelStart = nCurPos
this.SelLength = len(allt(tbl_inventario.nombre)) - nCurPos
nodefault
exit
endif
next x
thisform.grid1.refresh
endif
select tbl_inventario
total = reccount()
if between(nKeyCode, 32, 122)
for x = 1 to total
go x
if upper(subs(tbl_inventario.nombre, 1, this.selstart+ 1)) = ;
upper(subs(this.text, 1, this.selstart)+chr(nKeyCode))
nCurPos = this.selstart + 1
this.Value = tbl_inventario.nombre
this.SelStart = nCurPos
this.SelLength = len(allt(tbl_inventario.nombre)) - nCurPos
nodefault
exit
endif
next x
thisform.grid1.refresh
endif
Etiquetas:
Fox pro
Suscribirse a:
Entradas (Atom)