How can I override database field values?
I’ve inherited a system that has about 100 label formats with the same 50 database fields defined on each of them. Each label uses one or more of the fields that are appropriate for that label.
Labels are now generated using file integrations, but we would like to convert them to use web service integrations instead, with the fields and values passed in as JSON data. I’d really like to be able to do this without having to drastically modify each individual label, but I’m having a hard time figuring out how to override the data source to use the values passed in via the web service call.
Ideally I would end up passing in every value needed to generate the label – not only the data, but the name of the BTW file, the printer, the number of copies, etc. I’ve tried to generate a script and pass it to be used by the Print BTXML Script action but haven’t had any luck.
The script looks like this:
<XMLScript Version="2.0" Trusted="true">
<Command Name="Print Document">
<Print SaveAfterPrintCondition="IfModified" ActionInitiated="true" ReturnPrintData="false" ReturnSummary="false" ReturnLabelData="false" ReturnChecksum="false" ReturnDataSources="false">
<Format CloseAtEndOfJob="false" SaveAtEndOfJob="false" RegenerateThumbnail="false">{{format.btw}}</Format>
<PrintSetup>
<UseDatabase>false</UseDatabase>
<IdenticalCopiesOfLabel>1</IdenticalCopiesOfLabel>
<Printer>PDF</Printer>
<PrintToFileName MakeUnique="true" SelectAtPrintTime="false">{{filename}}</PrintToFileName>
</PrintSetup>
<RecordSet Name="Label" Type="btXML" AddIfNone="true">
<XMLData><![CDATA[<Variables>
<Variable Name='Name' Value='XXXXX' />
<Variable Name='Address1' Value='AAAAA' />
<Variable Name='Address2' Value='BBBBB' />
...
<Variable Name='PrintDocument' Value='{{format.btw}}' />
<Variable Name='PrinterName' Value='PDF' />
</Variables>]]></XMLData>
</RecordSet>
</Print>
</Command>
</XMLScript>
It generates 1 label for each variable in the script, with the variable value appearing in the first field and all other fields are empty.
I've also tried the Print Document action and checked the override data box, but that just generates labels using the original database files.
Can anyone point me to any resources that might help me out?
Thanks!!
Pete
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
0 Kommentare