Print Multiple Records With a Single Call to Your Web Service Integration
Overview
When using Web Service Integrations for automated printing, print jobs are initiated through HTTP web requests. To reduce network traffic you may want to print multiple labels with a single web request.
This article will show you how to send a web request for multiple records.
Applicable to
BarTender 2022 and later
Automation Edition and higher
Integration Builder
Information
Setting up a Web Service Integration
Review the article below for instructions on how to create your Web Service Integration:
Building a web service integration
Using BTXML
Setup the database file
- Create a comma-separated CSV file where the first line contains the field names as shown in the example below.
FirstName,LastName,City,Zip Code
Adam,Jones,Bellevue,98008,
John,Smith,Kirkland,98293
Setup the BTW file
- Create a new BTW file and add text objects for each of the database fields.
- Set up a Named Database Connection and connect the fields to your text objects. To see how you can set this up, review the following tutorial: Getting started with database connections (Video - 5:20)
- Make a note of the database connection name as you will need it to create the BTXML file:
Setup the BTXML file
- Format: The path for the btw file that should be printed
- RecordSet: the name of the database connection for the btw file with type btTextFile since we are using a CSV format
- UseFieldNamesFromFirstRecord: Set to true since the first line contains the field names.
- TextData: the records to be printed
- For detailed documentation for the tags available for BTXML review the following help pages:
Getting Started with BTXML Script
Setup the Web Service Integration
- Create a new Web Service Integration.
- Under Service set the Service name you would like and take note of the resulting URL Path. This is how you will be able to address the Integration when it is running.
- Set Input Data Format to BTXML Script:
- Delete the Print Document action and add a Print BTXML Script action.
- Make sure Script is set to the EventData variable.
- Before deploying, you can test the Integration to make sure it is processing your requests correctly
Remember that you must send your Post requests to the URL shown under Service.