Buenas Buenas gente.
Utilizo la funcion FW_DBFTOEXCEL() y todo va bien me convierte cualquier dbf en la planilla
...ahora la pregunta como hago para salvar la planilla excel?
Desde ya muchisimas gracias
Saludos
FWH 32/64 14.04 - PellesC
FW_DbfToExcel( [cFieldList], [bFor], [bWhile], [nNext], [nRec], [lRest], [cSaveTo], [lShow] ) --> oSheet
FW_DbfToExcel( nil, nil, nil, nil, nil, nil, "c:\folder\mytest.xlsx" )
oSheet := FW_DbfToExcel()
ExcelBookSaveAs( oSheet:Parent, cFileName )
nageswaragunupudi wrote:Syntax:
- Code: Select all Expand view
FW_DbfToExcel( [cFieldList], [bFor], [bWhile], [nNext], [nRec], [lRest], [cSaveTo], [lShow] )
Specify the name of the file (with full path ) to be saved as the 7th parameter.
Example:
- Code: Select all Expand view
FW_DbfToExcel( nil, nil, nil, nil, nil, nil, "c:\folder\mytest.xlsx" )
return nil
return oSheet
oSheet := MY_DBFTOEXCEL(...)
// if you want to save:
oSheet:Parent:SaveAs( cFile )
function ArrayToExcel2( aData )
local oExcel, oBook, oSheet
local cText, oClp, nCols := 0
if ( oExcel := ExcelObj() ) == nil
? "Excel not instqalled"
else
oBook := oExcel:WorkBooks:Add()
oSheet := oBook:ActiveSheet
oExcel:ScreenUpdating := .f.
aData := AClone( aData )
AEval( aData, { |a| nCols := Max( nCols, Len( a ) ) } )
AEval( aData, { |a,i| aData[ i ] := FW_ArrayAsList( a, Chr( 9 ) ) } )
cText := FW_ArrayAsList( aData, CRLF )
oClp := TClipboard():New()
oClp:SetText( cText )
oSheet:Cells( 1, 1 ):Select()
oSheet:Paste()
oClp:Clear()
oClp:End()
oSheet:Range( oSheet:Columns( 1 ), oSheet:Columns( nCols ) ):AutoFit()
oExcel:ScreenUpdating := .t.
oExcel:visible := .t.
endif
return nil
function ArrayToExcel2( aData, aHead )
local oExcel, oBook, oSheet
local cText, oClp, nCols := 0
if ( oExcel := ExcelObj() ) == nil
? "Excel not instqalled"
else
oBook := oExcel:WorkBooks:Add()
oSheet := oBook:ActiveSheet
oExcel:ScreenUpdating := .f.
aData := AClone( aData )
if !Empty( aHead )
HB_AIns( aData, 1, aHead, .t. ) // for xHarbour AINS(...)
endif
AEval( aData, { |a| nCols := Max( nCols, Len( a ) ) } )
AEval( aData, { |a,i| aData[ i ] := FW_ArrayAsList( a, Chr( 9 ) ) } )
cText := FW_ArrayAsList( aData, CRLF )
oClp := TClipboard():New()
oClp:SetText( cText )
oSheet:Cells( 1, 1 ):Select()
oSheet:Paste()
oClp:Clear()
oClp:End()
oSheet:Range( oSheet:Columns( 1 ), oSheet:Columns( nCols ) ):AutoFit()
if !Empty( aHead )
oSheet:Rows( 1 ):Font:Bold := .t.
endif
oExcel:ScreenUpdating := .t.
oExcel:visible := .t.
endif
return nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 38 guests