I.T. Discussion Community!
-Collapse +Expand
Search Paradox Group:

-Collapse +Expand Paradox To/From
-Collapse +Expand Paradox Store

Prestwood eMagazine

February Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Paradox & Ob...ObjectPAL Co...OPAL: Langua...   Print This     
  From the April 2010 Issue of Prestwood eMag
Paradox OPAL: Language Details:
Importing and Exporting Spreadsheets
Posted 12 years ago on 6/5/2008
Take Away: Demo of importing and exporting spreadsheets using ObjectPAL.


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:

exportSpreadSheet(const fileName String, const tableName String, [, const makeRowHeaders Logical]) Logical

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")
message("Export not successful")

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.

Linked Message Board Threads

 exportSpreadsheet to Excel in Paradox to/from Other Data Sources MB Topic (3 replies)
 Importing an Excel Spreadsheet in Paradox to/from Other Data Sources MB Topic (3 replies)
 importing excel spreadsheets in Paradox to/from Other Data Sources MB Topic (0 replies)


Share a thought or comment...
Comment 1 of 1

hi Mike,
with exportSpreadsheet I export table also to *.csv file (not documented)
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.

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
exportSpreadsheet("SALES.DB", "SALESrep.xls", True)
I don't know how to change CharSet or coding of exported file.

thanks for some suggestion!
marian chovan 

Posted 9 years ago
Write a Comment...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.

Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1231A1
Enter key:
KB Post Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101166 Counter
Since 6/5/2008

Follow PrestwoodBoards on: 

©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech