RecordSet Tag |
The root tag for Record Set tags. The Record Set tags configure how BarTender uses record set data.
<RecordSet Name=Value Type=Value [AddIfNone=Value]>...</RecordSet>
The supported attributes include the following.
Attribute |
Required/Optional |
Description |
||
---|---|---|---|---|
Name |
Required |
Specifies the name of the record set.
|
||
Type |
Optional |
Specifies the type of the record set. Valid values are as follows:
|
||
AddIfNone |
Optional |
Adds the record set as a text file database connection if no other text file database connections exist. Applies only to the Text File database type (btTextFile). The default is false if not specified. |
The following child element tags are supported.
Tag |
Required/Optional |
Description |
---|---|---|
Optional |
Sets the field delimitation type for a text record set. |
|
Optional |
Sets the field delimiter for a text file that uses Custom Field delimitation. Valid for Text record set types only. |
|
Optional |
Sets the file name that is used for Text or SAP IDoc record set types. |
|
Optional |
Sets the number of fields to scan per record in a Text record set. |
|
Optional |
Sets the password that is used to log in to the database. Used for OLEDB and ODBC record set types. |
|
Optional |
Sets the SQL statement that is used for OLEDB and ODBC record set types. |
|
Optional |
Sets the text data for the record set. Valid only for text record set types. Available for the Print command but not the FormatSetup command. |
|
Optional |
Sets whether to use the field names from the first record of a text file. Valid only for Text record set types. |
|
Optional |
Sets the user ID that is used to log in to the database. Used for OLEDB and ODBC record set types. |
When the database type is btTextFile, the record set loops through all of the available text database files as it tries to locate the correct file. If the correct file is found, the file is replaced with the temporary file name and data. If the text database is not found but AddIfNone is set to true, a text database is added. If no text database is found and AddIfNone is set to false, the print job stops, and the following error message is displayed:
Database is not found. Please check your BarTender document database connections.
When the database type is btOLEDB, btODBC or btSAPIDOC, the AddIfNone attribute is ignored, and the record set loops through all of the available database files as it tries to find the correct file. If the correct file is found, all child settings and actions are applied to the file. If the database is not found, the print job stops, and the following error message is displayed:
Database is not found. Please check your BarTender document database connections.
<RecordSet> is an optional tag that can be used with the <FormatSetup>, <Print>, and <ExportPrintPreviewToImage> commands.
The following sample code shows the <RecordSet> tag that is contained in the <Print> command. The <RecordSet> tag can also be contained in the <FormatSetup> and <ExportPrintPreviewToImage> commands.
<?xml version="1.0" encoding="utf-8"?>
<XMLScript Version="2.0" Name="09232006_103601_Job1" ID="123">
<Command Name="Job1">
<Print>
<Format>Document1.btw</Format>
<RecordSet Name="Text Document 1" Type="btTextFile">
<Delimitation>btDelimQuoteAndComma</Delimitation>
<UseFieldNamesFromFirstRecord>true</UseFieldNamesFromFirstRecord>
<TextData>
<![CDATA["FirstName","LastName","City","Zip Code"
"Jennifer","Jones","Bellevue","98008"
"John","Smith","Kirkland","98293"]]>
</TextData>
</RecordSet>
</Print>
</Command>
</XMLScript>
BTXML script version 1.0 (BarTender 8.0 and later versions)