RecordSet Tag

ClosedDescription

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

ClosedSyntax

<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.

If you are connecting to ODBC or OLE DB sources, you must specify the name of the database for the Name attribute.

Type

Optional

Specifies the type of the record set. Valid values are as follows:

  • btAccess: Microsoft Access type database

  • btDataBuilder: BarTender DataBuilder type database

  • btExcel: Microsoft Excel type database

  • btODBC: ODBC type database

  • btOLEDB: OLE type database

  • btSAPIDoc: SAP IDoc document that contains data

  • btTextFile: Text file that contains delimited data

  • btXML: XML file

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.

ClosedChild Elements

The following child element tags are supported.

Tag

Required/Optional

Description

Delimitation

Optional

Sets the field delimitation type for a text record set.

FieldDelimiter

Optional

Sets the field delimiter for a text file that uses Custom Field delimitation. Valid for Text record set types only.

FileName

Optional

Sets the file name that is used for Text or SAP IDoc record set types.

NumberOfFields

Optional

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

Password

Optional

Sets the password that is used to log in to the database. Used for OLEDB and ODBC record set types.

SQLStatement

Optional

Sets the SQL statement that is used for OLEDB and ODBC record set types.

TextData

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.

UseFieldNamesFromFirstRecord

Optional

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

UserId

Optional

Sets the user ID that is used to log in to 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 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.

ClosedExample

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>

ClosedRequirements

BTXML script version 1.0 (BarTender 8.0 and later versions)