Take Away: Demo of importing and exporting spreadsheets using ObjectPAL.
KB101166
You can use the following procedures to export data:
exportASCIIFix()
exportASCIIVar()
exportParadoxDOS()
exportSpreadSheet()
Let's focus on spreadsheets. You can import or export Quattro, Excel, or Lotus spreadsheets with ObjectPAL. You pass these procedures a few parameters, and it takes over. You can use importSpreadSheet() to import and exportSpreadSheet() to export.
Use exportSpreadSheet() when you wish to export any of the following spreadsheets to a table: Quattro Pro for Windows, Quattro Pro DOS, Quattro, Lotus 2.x, Lotus 1.A, and Excel 3.0/4.0/5.0. Following is the syntax:
The parameters are fairly straight forward. Specify the input spreadsheet file name with the fileName parameter. Specify the output table name with tableName. Finally, specify whether you want the spreadsheet's column labels to determine the field names of the table with makeRowHeaders. If successful, exportSpreadSheet() returns True; otherwise, it returns False. For example, the following single line of code exports an Excel spreadsheet named SALES.XLS to a Paradox table named SALES.DB:
method pushButton(var eventInfo Event)
if exportSpreadsheet("SALES.XLS", "SALES.DB", True) then
message("Export successful")
else
message("Export not successful")
endIf
endMethod
Note: You are specifying the spreadsheet format (type), with the extension on the fileName parameter. Valid extensions are: WB1, WB2, and WB3 for Quattro Pro for Windows, WQ1 for Quattro Pro for DOS, WKQ for Quattro, WK1 for Lotux 2.x, WKS for Lotus 1.A, and XLS for Excel.
hi Mike, with exportSpreadsheet I export table also to *.csv file (not documented) e.g. exportSpreadsheet("SALES.DB", "SALESrep.csv", True) it creates csv file with column names in first row. But CharSet=DB437US0 and I don't know how to change it.
With exportASCIIVar(("SALES.DB", "SALESrep.csv", ";", "", False, True) CharSet is same like SALES.DB has, but with no column names in first row.
Also when I export to *.xls e.g. exportSpreadsheet("SALES.DB", "SALESrep.xls", True) I don't know how to change CharSet or coding of exported file.