Buenas tardes, ¿a través de este ejemplo puedes demostrar lo que realmente quieres?
Code: Select all | Expand
// C:\FWH\SAMPLES\OSCARXLS.PRG
#include 'FiveWin.ch'
#include 'xBrowse.ch'
FUNCTION Main()
LOCAL oWnd, oBar, oBrw, nTotal := 0
/*
A. American format: "999,999,999.99"
E. European format: "999.999.999,99"
I. Indian format: "99,99,999.99"
*/
FwNumFormat( 'E', .T. ) // European Format
IF FILE( "TESTXLS.DBF" )
DELETEFILE( "TESTXLS.DBF" )
ENDIF
dbCreate( "TESTXLS", { { "DESCRIP", "C", 010, 000 }, ;
{ "VALOR1 ", "N", 010, 001 }, ;
{ "VALOR2 ", "N", 010, 002 }, ;
{ "VALOR3 ", "N", 010, 003 }, ;
{ "VALOR4 ", "N", 010, 004 }, ;
{ "VALOR5 ", "N", 010, 005 } } )
USE TESTXLS NEW ALIAS TESTXLS
GO TOP
FOR nTotal = 1 TO 33
APPEND BLANK
REPLACE DESCRIP WITH "Linea " + StrZero( nTotal, 2 )
REPLACE VALOR1 WITH 99999 * nTotal / 777
REPLACE VALOR2 WITH 99999 * nTotal / 777
REPLACE VALOR3 WITH 99999 * nTotal / 777
REPLACE VALOR4 WITH 99999 * nTotal / 777
REPLACE VALOR5 WITH 99999 * nTotal / 777
COMMIT
NEXT
GO TOP
DEFINE WINDOW oWnd
DEFINE BUTTONBAR oBar OF oWnd SIZE 80, 32 2007
DEFINE BUTTON OF oBar PROMPT 'Para &Excel' ;
ACTION MsgMeter( {| oMeter, oText, oDlg, lEnd | ;
Export2Excel( oBrw, oMeter, oText, oDlg, @lEnd ) } )
DEFINE BUTTON OF oBar PROMPT '&Salida' ACTION( WndMain():End() )
SET MESSAGE OF oWnd TO '' 2007
@ 0, 0 XBROWSE oBrw OF oWnd ALIAS 'TESTXLS' AUTOCOLS CELL LINES
oBrw:aCols[ 2 ]:bFooter = {|| Transform( Field->VALOR1, "@E 9.999.999,99" ) }
oBrw:aCols[ 3 ]:bFooter = {|| Transform( Field->VALOR2, "@E 9.999.999,99" ) }
oBrw:aCols[ 4 ]:bFooter = {|| Transform( Field->VALOR3, "@E 9.999.999,99" ) }
oBrw:aCols[ 5 ]:bFooter = {|| Transform( Field->VALOR4, "@E 9.999.999,99" ) }
oBrw:aCols[ 6 ]:bFooter = {|| Transform( Field->VALOR5, "@E 9.999.999,99" ) }
oBrw:MakeTotals()
oBrw:refresh()
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd MAXIMIZED
CLOSE DATA
RETURN NIL
STATIC FUNCTION Export2Excel( oBrw, oMeter, oText, oDlg, lEnd )
oBrw:ToExcel( {| n, t | oMeter:nTotal := t, ;
oMeter:Set( n ), ;
oText:SetText( Str( n ) + '/' + Str( t ) ), ;
oDlg:Update(), .T. } )
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.