Se inio el proceso de exportacion de Consultas a otros formatos, por ahora estan listo TEXTOS y EXCEL, la idea es exportar a HTML, WORD, SQL SCRIPT, XML y por supuesto DBF
Se pueden personalizar encabezados y finales de archivo y manipular linea a linea creada
Started queries export process to other format, for now is working TEXT and EXCEL, the idea is export to HTML, WORD, SQL SCRIPT, XML and off course DBF
We can customize Headers and Footers and handle row by row
Samples to TEXT
Download here
oQry = oServer:Query( "SELECT first, last FROM clientes limit 100" )
oExp = oQry:Export( EXP_TEXT, "client.txt" )
oExp:bOnStart = {| o | FWrite( o:hFile, Replicate( "=", Len( cHead ) ) + CRLF, Len( cHead ) + 1 ),;
FWrite( o:hFile, cHead, Len( cHead ) ),;
FWrite( o:hFile, Replicate( "=", Len( cHead ) ) + CRLF , Len( cHead ) + 1 ) }
oExp:bOnRow = {| o, n, cText| ShowLine( o, n, cText, oQry:LastRec() ) }
oExp:bOnEnd = {| o | FWrite( o:hFile, Replicate( "=", Len( cEnd ) ) + CRLF, Len( cEnd ) + 1 ),;
FWrite( o:hFile, cEnd, Len( cEnd ) ) }
Export to Excel
Download Here
oQry = oServer:Query( "SELECT first, last, salary FROM clientes limit 20" )
oExp = oQry:Export( EXP_EXCEL, CurDrive() + ":\" + CurDir() + "\client", , { , , "999,999.99" } )
oExp:lMakeTotals = .T.
oExp:bOnStart = {| o | Header( o ) }
oExp:bOnRow = {| n, cText| ShowLine( n, cText, oQry:LastRec() ) }
No hay comentarios:
Publicar un comentario