Recent News
|
InnPlanner 2010 Released
New faster database engine, more customization features, weekly tariffs, full multi-user work support and much more...
| |
InnPlanner 2010 RC1
InnPlanner 2010 Release Candidate 1 is ready for downloading and testing. You can download it from the "Downloads" section.
|
|
|
Hotel Software Documentation
Exporting to 3rd part DB using script
Exporting to 3rd part DB using script |
Introduction
Besides basic data export, i.e. setting correspondence between fields, while exporting data it is available to change cells of a different database using a script. It may be quite useful, in cases when it is not possible to find the exact correspondence between your DB fields and fields of the DB you need to export to.
Example
The easy way to understand script usage is to give an example. For instance, there is an Excel-based DB stored at "c:\example.xls". Suppose, the main sheet of this DB has the following cells:
| Report Date: | - | -
| | - | - | -
| | Title | Quantity | Price
| | - | - | -
|
We need to fill in this document using data from our database.
- Open export dialog box (File->Import/Export->Export To 3rd Part Database.)
- Choose example.xls database and tables within this database.
- Go to Advanced tab and set Don't export records. I will use script to update external database flag.
- Open the script editor by clicking on Edit Script
- Create another script by using "Export DB Operation" action:
Script listing:
- Line 1. Go to the first line in the table;
- Line 2. Start data editing of this line;
- Line 3. Enter the current date in cell #2;
- Line 4. Save changes;
- Line 5. Get a number of records into [$records] variable using a query;
- Lines 6, 12 Perform lines 7-11 for each record of the set;
- Line 7. Add the record to the table;
- Lines 8-10. Enter the records from our database into the Excel table.
- Line 11. Save changes;
- Save the script and click on the "Export" button.
If everything was done correctly, the file example.xls should contain the following data:
| Report Date: | 10.11.2007 | -
| | - | - | -
| | Title | Quantity | Price
| | - | - | -
| | Apple | 16 | $32
| | Lemon | 4 | $12
|
Saving export settings as a template will allow to edit the created script from the script editor (Designer->Edit Database Scripts).
See Also:
Synchronization
Importing/Exporting from 3rd part DB.
Custom Export Editor
Custom Import (Parsing)
|
|
|
|
Today"s Poll
What software do use for your inn/b&b/hotel/etc?
|