No Labels Are Printed As Soon As I Add The Recordset Tag. 追蹤

0
Avatar
Legacy Poster

Hello all,

 

I am currently experiencing some issues while trying to print some labels.

 

This script prints just fine:

<?xml version="1.0" encoding="UTF-8"?>
<XMLScript Version="2.0">
<Command Name="Job1">
<Print>
<Format CloseAtEndOfJob="true">D:\Formats\PD02.btw</Format>
<PrintSetup><Printer>TEST_PR</Printer><IdenticalCopiesOfLabel>02</IdenticalCopiesOfLabel></PrintSetup>
</Print>
</Command>
</XMLScript>
 

But as soon as I add the RecordSet tag, nothing comes ou the printer and worst: no error message are given. Bartender prentends everything is fine and the log output is this xml:

<?xml version="1.0" encoding="UTF-8"?>
<XMLScript Version="2.0">
<Command Name="Job1">
<Print>
<Format CloseAtEndOfJob="true">D:\Formats\PD02.btw</Format>
<PrintSetup><Printer>TEST_PR</Printer><IdenticalCopiesOfLabel>02</IdenticalCopiesOfLabel></PrintSetup>
<RecordSet Name="Text File 1" Type="btTextFile">
<TextData> 


<![CDATA["V07","V09","V17","V19","Adam","Jones","Bellevue","98008","John","Smith","Kirkland","98293"]]> 


</TextData> 


</RecordSet> 
</Print>
</Command>
</XMLScript>
 

Any idea?

 

Thank a lot for your help.

3 意見

0
Avatar
Fernando Ramos Miracle
版主
評論操作 永久連結

Is there a database connection configured in the PD02.btw document (in your case you'll need a text file type connection)?

 

You'll need to create a "model" text file with the same characteristics as the record set used on your XML scrip (same data type and number of fields), then when running this script the existing text file will be substituted by the temporary one generated by the <RecordSet> tag.

 

Note that when designing your document you also need to specify which objects source from which database field so the information ends up in the correct object.

 

Please try this and let me know how you get on.

0
Avatar
Legacy Poster
評論操作 永久連結

Hello Fernando,

 

Thank a lot for the answer. There is no connection to a database.

 

The XML file is created by SAP and we are currently using <NamedSubString Name="V94"><Value>KG</Value></NamedSubString>.

 

This is working fine.

 

 

 

 

Now, the extra step is to print multiple labels on a single sheet.


While using older Bartender version, it was really easy, we used this file:

 

 

%BTW% /AF=D:\Data\Seagull\BarTender\Formats\PD03.btw /D=<Trigger File Name> /PRN="sl13_pr" /C=1 /R=3 /P /DD
%END%
vt01;vt02;vt03;vt04;v17;v19;v27;v29;v34;v43
SIZE(CM X M);QTY;XXXX ORDER NR;CUSTOMER ORDER NR;1;17.8 X 2040;Anonymous;SD45645431;C1;1
;;;;1;17.8 X 2020;Anonymous;SD360351;C1;1
;;;;2;17.8 X 2050;Anonymous;SD360351;C1;1
 

According to the documentation of the new system with XML files, we understood that we needed to use the RecordSet and TextData tags.

 

So, we have simply copy pasted the example from the Bartender help and modified it to make it work (or are currently trying to)

 

So, a simple way to express the question would be:

 

Have you a sample or a link to an xml file that would allow us to print multiple labels per sheer with the equivalent of: <NamedSubString Name="V94"><Value>KG</Value></NamedSubString>.

 

Thank a lot.

0
Avatar
Fernando Ramos Miracle
版主
評論操作 永久連結

Firstly please note that the above example (the use of Commander script) is still fully supported in our latest versions of BarTender.

 

*Of course the use of XML script will offer many more possibilities over your print jobs.

 

In any case, if you wish to print several labels per sheet, all these labels need to be contained in the same print job (a new print job will always start at the beginning of a new page).

 

To have all your different labels on the same print job using XML script you can try the following:

 

1. One option would certainly be using the <RecordSet> tag with XML script, but on this case you will need to use a BarTender document with an existing database connection (in the exact same way as when using a Commander script trigger file working as database).

 

2. On the other hand you could also use the <NamedSubString> tag but you won't be able to modify the label information dynamically over the same print job (apart of serialization and VB Script applied to the document). In this case, you would need to use several "Templates" on one single BarTender document, modifying the data from all the different templates at the beginning of the print job (the template feature is only available since BarTender v10).

 

*Of course you can also use a text file as a simple database (or with Commander script).

登入寫評論。