Use Commander Task To Read/execute Btxml Script
Hello, so far I am making pretty good progress setting things up and running until I start to pass cdata in the btxml script. The commander task reads and executes the btxml script without any problem before I packed in some cdata in the script. Anyone has an idea? might it be related to label design? I did make sure the two field names in the first line are matching what I have in the label document.
attached two screen shots: the one without the cdata sent the label to the printer without a problem, the one with cdata just did not do anything, no error message either.
Thanks in advance for your help.
ps. I also tried to send the data first, and then use a FileName and it did not work either.
(Bartender Enterprise Automation 10.1 SR2
Windows 2008 Server R2.)
Ben
-
Did you setup the BarTender document to connect to a dummy data file of the same field structure when designing the label? Could you attach the trigger file, Commander task file, and BarTender document to examine?
If you run the BTXML script from within BarTender, via the "File>Run BTXML script" menu item, what do you get?
The Commander trouble-shooter PDF should be of help:
http://forums.seagullscientific.com/index.php?/topic/55-commander-troubleshooting/
0 -
Legacy Poster
★ BarTender Hero ★
Thank you Ian. the keyword being "setup ... to connect ... the same field structure" I guess. because I did not have the double quotes in my dummy data file but I did when passing the data through btxml script.
I changed the Delimitation to "btDelimComma" only (no double quotes) and it seemed to work -- another "double-quote-got-me" issue. Thanks for the hint.
(btw, the more I explore the Bartender, the more impressed the product gets. it is really a great product that does, or let user do whatever humanly possible -- of course within its own realm that is).
0 -
Great, thanks for the feedback. And yes, we plan on even greater stuff for BarTender in future releases -- stay tuned! :)
0 -
Legacy Poster
★ BarTender Hero ★
Hello,
I am trying to Print label using BTXML and bartender Commander TCP/IP Task.
My XML looks like this
<XMLScript Version="2.0">
<Command>
<Print JobName="label_print_job_label_print_job_HP2050dn">
<Format CloseAtEndOfJob="true" SaveAtEndOfJob="true">C:\LEXON\BCMASKS\3x5truck_1.btw</Format>
<PrintSetup>
<IdenticalCopiesOfLabel>2</IdenticalCopiesOfLabel>
<Printer>\\LEXDEV03\HP2050dn</Printer>
</PrintSetup>
<RecordSet Name="3x5truck_datasource" Type="btTextFile" AddIfNone="true">
<Delimitation>btDelimMixedQuoteAndComma</Delimitation>
<UseFieldNamesFromFirstRecord>true</UseFieldNamesFromFirstRecord>
<TextData><![CDATA["BOLNUM","STNNAME"
"ORD111111_!!!!","DOLLAR TREE MERCHANDISING_!!!!"]]></TextData>
</RecordSet>
</Print>
</Command></XMLScript>
If i get rid of the <RecordSet> element print label but since no data is passed it just prints a blank label. If i add the record set element it error out with BarTender: Error Message # 3908
Database "3x5truck_datasource" with type "TextFile" is not found. Please check you documents database connection.
Thanks for the help in advance.
Attached is the error message popup and .btw file.[attachment=1542:Untitled3.png][attachment=1543:3x5truck_1.btw]
0 -
Start off by inserting this at line 1.
<?xml version="1.0" encoding="utf-8"?>
Do you get this error when running the BTXML directly from a manually opened BarTender via the "File>Run BTXML Script" menu item?
Is the D:\ drive a mapped network drive or a local drive/partition. Note that you shouldn't use mapped drive references in a Commander context, particularly when running as a service, as they are user specific and do not function when the user account that has the mapped drive configured is not actively logged in as an interactive user. Instead you should make UNC path references. For example: \\ComputerName\ShareName
0 -
Legacy Poster
★ BarTender Hero ★
Thanks Ian.
I do have the line
<?xml version="1.0" encoding="utf-8"?> in my btxml sorry i missed it when pasting the code.
No i am trying to print the label through a Java program, this program open a socket connection and passes the input stream (btxml) to the Bartender commander. Bartender commander gets the btxml, the btxml is logged on the commander logging console but it does not spit out any label. If i pass the btxml without the <recordset> element everything work fine. It recognizes the printer and issue a print command to the printer and i get the blank label but the moment i add the <recordset> element it does not print any label commander just does not do anything.
To further trace down what exactly the problem is what i did was in Bartender -> Commander -> Task option -> Trigger TCP/IP Socket
I checked the "Saved Received Data to File" option and save the btxml to a location and then went into the bartender Suite directory and execute the command
C:\Program Files (x86)\Seagull\BarTender Suite>bartend.exe /XMLScript="D:\bartender\test_btxml.btxml"
and it poped-up the above error message.
0 -
Run the BTXML directly in BarTender for testing purposes, thereby cutting Commander out of the investigation. Does it work yes or no? If no then it's easier to see why within the BarTender application window itself.
Did you take note of what I said about mapped drives? Does the user account used by Commander have access to the folder mentioned in the error message?
Try changing the <RecordSet> tag line to look like this:
<RecordSet Name="MyTest" Type="btTextFile">
0 -
Legacy Poster
★ BarTender Hero ★
Hi Ian,
Yes the commander user account has access to the folder mentioned in error message. I have the Commander installed on my local machine and am the super user of this machine and also the folder in error message is created by me.[attachment=1544:3x5truck_3.btw][attachment=1545:3x5truck_datasource_1.txt]
As instructed i changed the record set line and created a btxml under D drive and executed the following command
bartend.exe /XMLScript="D:\Noname1.btxml"
It failed with same error message popup saying Datasource "MyTest" does not exists.
Attached is the error message console and .btw file
My BTXML is this
<?xml version="1.0" encoding="utf-8"?>
<XMLScript Version="2.0">
<Command>
<Print JobName="label_print_job_label_print_job_HP2050dn">
<Format CloseAtEndOfJob="true" SaveAtEndOfJob="true">C:\LEXON\BCMASKS\3x5truck_3.btw</Format>
<PrintSetup>
<IdenticalCopiesOfLabel>2</IdenticalCopiesOfLabel>
<Printer>\\LEXDEV03\HP2050dn</Printer>
</PrintSetup>
<RecordSet Name="MyTest" Type="btTextFile">
<Delimitation>btDelimMixedQuoteAndComma</Delimitation>
<UseFieldNamesFromFirstRecord>false</UseFieldNamesFromFirstRecord>
<TextData><![CDATA["ORD111111","DOLLAR TREE MERCHANDISING"]]></TextData>
</RecordSet>
</Print>
</Command></XMLScript>[attachment=1546:3x5truck_datasource_1.txt][attachment=1547:3x5truck_3.btw]0 -
Hmm, try this. Change the RecordSet Name attribute to be "Text File 1" like in the below example. That should do the trick.
<RecordSet Name="Text File 1" Type="btTextFile">
0 -
Legacy Poster
★ BarTender Hero ★
Sorry for the late reply, you are right the recordset name in the .btw and .btxml should match.
It worked thank you
0 -
Legacy Poster
★ BarTender Hero ★
Same issue here. But I can't follow exactly what you changed in the .btw file to get this resolved. Did you just rename the txt source to "Text File 1"?
Many thanks for sharing your solution.
0 -
Legacy Poster
★ BarTender Hero ★
After more testing and comparing various failed test runs we noticed that the txt datasource is called "Text File 1" when added for the first time to the .btw. When subsequently modifying the datasource it looks like it is being 'automatically' renamed to the name of the txt datafile instead. This is very confusing. Even when nothing changes, but we just open the database properties of the .btw by clicking "configure connection" and entering through the fields (changing nothing) the datasource name is updated from "Text File 1" to the actual name of the .txt file. Is this intended?
0 -
mrafulfillnh: From what you describe, that would be expected yes.
0
Iniciar sesión para dejar un comentario.
Comentarios
13 comentarios