Páginas

sábado, 4 de outubro de 2014

Exporta Txt/Excel/Word/Xml

Exporta Txt/Excel/Word/Xml

 C:\WinDev 19\Examples\Training\WD Export table\Exe




 sPath is string
sText is string

sPath = CompleteDir(fExeDir())

SWITCH Open(ExportChoice)
    CASE 1 // Export to a Text file
        sText = TableToText(Table,taNoTitle)
        fSaveText(sPath+"Export.txt",sText)
        IF YesNo("Data exported to "+sPath+"Export.txt",“”,"Open the text file?") THEN
            ShellExecute(fShortPath(sPath+"Export.txt"))
        END
      
    CASE 2 // Export to the clipboard
        TableToClipboard(Table)
        Info("Data exported to clipboard.")
    CASE 3 // Export to Word
        TableToWord(Table,sPath+"Export.rtf")
        IF YesNo("Data exported to "+sPath+"Export.rtf",“”,"Open the file with Word?") THEN
            ShellExecute(fShortPath(sPath+"Export.rtf"))
        END
    CASE 4 // Export to Excel
        TableToExcel(Table,sPath+"Export.xls")
        IF YesNo("Data exported to "+sPath+"Export.xls",“”,"Open the file with Excel?") THEN
            ShellExecute(fShortPath(sPath+"Export.xls"))
        END
    CASE 5 // Export to an XML file
        TableToXML(Table,sPath+"Export.xml")
        IF YesNo("Data exported to "+sPath+"Export.xml",“”,"Open the file?") THEN
            ShellExecute(fShortPath(sPath+"Export.xml"))
        END
EN



Nenhum comentário:

Postar um comentário