RecordSet Tag

ClosedDescription

The root tag for Record Set tags. The Record Set tags set how BarTender uses recordset data.

ClosedSyntax

<RecordSet Name=Value Type=Value [AddIfNone=Value]>...</RecordSet>

The supported attributes include:

Attribute

Required/Optional

Description

Name

Required

Name of the record set.
NOTE: If you are connecting to ODBC / OLE DB sources. you must specify the name of the database for the Name attribute.

Type

Required

Type of record set. Valid values are:

  • btOLEDB: OLE type database.

  • btODBC: ODBC type database.

  • btSAPIDoc: SAP IDoc document containing data.

  • btTextFile: Text file containing delimited data.

AddIfNone

Optional

Adds the record set as a text file database connection if no other text file database connections exist. Only applies to the Text File database type (btTextFile). The default is false if not specified.

ClosedChild Elements

The following child element tags are supported:

Tag

Required/Optional

Description

Delimitation

Optional

Set the field delimitation type for a text record set.

FieldDelimiter

Optional

Set the field delimiter for a text file with Custom Field delimitation. Valid for Text record set types only.

FileName

Optional

Set the file name used for Text or SAP IDoc record set types.

NumberOfFields

Optional

Set the number of fields to scan per record in a Text record set.

Password

Optional

Set the password used to log into the database. Used for OLEDB and ODBC record set types.

SQLStatement

Optional

Set the SQL statement used for OLEDB and ODBC record set types.

TextData

Optional

Set the text data for the record set. Valid for text record set types only. It is available for the Print command but not the FormatSetup command.

UseFieldNamesFromFirstRecord

Optional

Set whether or not to use the field names from the first record of a text file. Valid for Text record set types only.

UserId

Optional

Set the user Id used to log into the database. Used for OLEDB and ODBC record set types.

ClosedParent Tag

<FormatSetup>
<Print>
<ExportPrintPreviewToImage>

ClosedRemarks

When the database type is btTextFile, the record set will loop through all of the available text database files looking for the correct file. If the correct file is found, it will replace the file with the temp file name/data. If the text database is not found, but AddIfNone is set to true, a text database will be added. If no text database is found and AddIfNone is set to false, the print job will stop and the following error will display: 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 will loop through all of the available database files looking for the correct file. If the correct file is found, it will apply all child settings and actions to the file. If the database is not found, the print job will stop and the following error will display: 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.

ClosedExample

This example demonstrates the <RecordSet> tag contained within the <Print> command. The <RecordSet> tag can also be contained within 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"

"Adam","Jones","Bellevue","98008"

"John","Smith","Kirkland","98293"]]>

</TextData>

</RecordSet>

</Print>

</Command>

</XMLScript>

ClosedRequirements

BTXML Script version 1.0 (BarTender 8.0 and higher)