DATABASE EXPORT
Overview
Selecting Output Formats

Changing Export Formats
Changing Available Options
Masterfile Templates
[Export] Section
[Header] Section
[Detail] Section
[Footer] Section

Fields and Control Characters
Field Name Specifier
Non Printable Characters
 

Overview
SELLmatix allows you to export data from the SELLmatix databases so that the data can be used by a range of other applications. Depending on how your business operates, it may be necessary to do this on a regular basis, or it may be necessary to export the data in a range of different formats, or it may be that you never need to export your SELLmatix data at all.

SELLmatix allows you to set up templates for a range of different types of data export which can be used again and again, so that once you have determined the data to be exported and the format in which it will be exported, you can repeat the export operation simply by selecting the type of export you wish to perform.

Selecting Output Formats When exporting data from SELLmatix, the Save as dialog appears allowing you to select the filename and other options about the data to be saved. At the bottom of this Dialog, you have the option to Save File as Type, and a drop down list allows you to select the type of export to perform.

Back to top

Changing Available Options
When you select one of these file type, you are really telling SELLmatix which export template should be used to export the data. The way that SELLmatix knows which export template to use is from the configuration file. The name of this configuration file is "SELLmatix Control.cfg". You can create new export templates, and change the options that appear in the "Save as Type" list when you go to export data from SELLmatix, by changing entries in the configuration file. You can edit the configuration file using a text editor such as Notepad, but make sure to save your changes in Unicode format.

In the [System] section of the configuration file, there are 2 lines for each type of export. These are something like...

ExportPLUTypes=QuickBooks Products (*.IIF),*.iif,MYOB Products (*.TXT),*.txt
ExportPLUFormats=QBPROD.EXP,MYOBPROD.EXP
These are lines of text, with fields separated by commas.

The first line, "ExportPLUTypes=" entry contains pairs of entries where the first entry in the pair contains the text that appears in the drop down list of "Save as type". The second entry in each "pair" of entries on the first line, contains the wildcard pattern to use to determine which files appear in the list of files above, when that entry pair is selected. For example, if you selected "MYOB Products (*.TXT)" from the dropdown list, the wildcard "*.TXT" would be used so that any file name with an extension.".TXT" would appear in the list of files.

The second line, "ExportPLUFormats=" entry contains a list of export templates which SELLmatix will use when exporting.

You can change the order in which options appear in this list, add new export templates or remove templates that you will not need.

Back to top

Masterfile Templates
Template files are Unicode text files which can be edited with a text editor such as Notepad. These files are similar in design to .ini files in that there are sections which are enclosed in square brackets, and then a number of statements of the form
"Variable=value"

The variables are key words which SELLmatix looks for when preparing output, and the text after the "=" is interpreted to produce the output.

No space can occur between the variable name and the equals sign. Spaces appearing after the equals sign are output as string literals in the output.

These export templates must be saved in Unicode format, even if only ANSI output is being produced.

[Export] Section

The export section contains general information about the exported data. The variables used in the [Export] Section are:-

Charset=
Valid values are "Ansi" or "Unicode". Case is not significant and the default is Ansi.

DateFormat=
valid values include "DD/MM/YY", or "MM/DD/YYYY" etc.

[Header] Section

The header section contains up to 10 lines of input which is interpreted and appears at the beginning of the output file. These lines are:-

Header Line=
Header Line1=
Header Line2=
...
Header Line9=

These lines are processed in numeric order, and the parser stops looking for lines when a line is not found. In other words, if "Header Line4=" did not appear in the [Header] Section, then "Header Line5=" and subsequent numbered header lines would not be processed, even if they existed.

The actual output of a header line may take up more than 10 lines, because it is possible to embed Carriage Returns, Line Feeds and other nonprintable characters in the output.

Normally headers are used to produce column headings if the data exported is to be used with a spreadsheet such as Excel or OpenOffice, or with an accounting package such as MYOB.

.IIF files which are imported into QuickBooks do require more than one header line to set up column names and section descriptions.

The Header section is processed once at the beginning of the export, before any records have been read from the database.

[Detail] Section
The detail section is processed once for each record in the database.

Up to 10 lines of data can be interpreted and processed for each record. These lines are of the form:-

Record Line=
Record Line1=
Record Line2=
...
Record Line 9=

These lines are processed in numeric order, and the parser stops looking for lines when a line is not found. In other words, if "Record Line4=" did not appear in the [Detail] Section, then "Record Line5=" and subsequent numbered Record lines would not be processed, even if they existed.

Record Lines are able to access fields in the database which is being exported. Refer to the section below to determine which fields are available during an export.

[Footer] Section

The footer section contains up to 10 lines of input which is interpreted and appears at the end of the output file. These lines are:-

Footer Line=
Footer Line1=
Footer Line2=
...
Footer Line9=

These lines are processed in numeric order, and the parser stops looking for lines when a line is not found. In other words, if "Footer Line4=" did not appear in the [Footer] Section, then "Footer Line5=" and subsequent numbered footer lines would not be processed, even if they existed.

The actual output of a footer line may take up more than 10 lines, because it is possible to embed Carriage Returns, Line Feeds and other nonprintable characters in the output.

Normally footers are not used.

The Footer section is processed once at the end of the export, after all records have been read from the database and processed.

Back to top

Fields and Control Characters
Database Fields

Fields in the appropriate database can be output in the [Detail] Section by enclosing the Database Field name in % percentage signs. There should be a % at the beginning of the field name and the end of the field name and any embedded spaces will be considered as part of the field name. Spaces are a valid character within field names, and are significant.

If a percentage sign needs to be included in output as a string literal, then it should appear as %% in the template.

For example, if you needed to output the literal text "97%" then in the output template would need to contain "97%%".

The actual fields available for export depend on the database being exported, and lists of the fields available appear below. Note that in field names case is significant.

Non printable characters

It is possible to embed any non printable character in the output stream by using a backslash character followed by the decimal character code for the character you want output. For example, if you wished to embed a Tab character (character code 9) in the output, you could express this as \009

If you need to output the backslash as a literal character in the output then you would do this by having a double backslash it the template, for example, "\\".

The most common reason to include nonprintable characters in the output is as a delimiter for fields in the data, so that the program importing the file knows where one field ends and the next field begins. Two common formats are comma separated and Tab separated. Comma separated files are less convenient because a comma may appear in the raw data, which causes the program reading the data to get the fields out of sync.

Tab separated data usually avoids this problem, but it can be difficult to read when editing the template to see where the tabs are. For this reason, it is often easier to represent tabs as \009.

Back to top