Printing label with two connected db in multi join through integration builder 追蹤

0
Avatar
Lukáš Janík

Hi, could you please help me with this example.

  1. two db in Multi-db Join

          a)Access db – contain text data for many labels

         b) txt file – generated from tester and will contain script and data for QR code on same label 

        (For example)

2. In integration Builder I used File integration, file detection rename file from dat to txt and run Print command script after that show integration builder error “No record found”

3. To choose which label will be printed I used this script

%BTW% /AF="C:\Temp\z\test\Test.btw" /P /?QueryPrompt1="4090-5257"

%END%

and works well, but there is no data for QR code, only print label with data from access db. Where do you think is a problem, in script or integration builder setting?

2 意見

0
Avatar
Pete Thane
評論操作 永久連結

That took some playing to get it working correctly!

You are using the old style Commander Script trigger and although you maybe to edit it to get it to work I would suggest that you use the enhanced features offered by Integration Builder as that was the only way I could get it up and running correctly.

To do this you will need manipulate your output trigger file layout and the label formats too.

  • In the label(s) delete the Text file database and just leave the label linked to the Access document. 
  • For each of the old text file linked database fields you need to amend these to Embedded Data as the Type and the use the Change Data Source Name button to give each a suitable name. For my testing I called my fields the same as the old field headings in your trigger file, such as MfgNo, SerNo etc.. I also adjusted the name of my Database Filter/Query from QueryPrompt1 to DBLookUp as you will see on the screenshots below.
  • For the Text trigger file I removed the %BTW%....%END% "brackets" and data and just left the QR code data but to this I added two new fields called LabelFile and LookUpCode and into these I added the name fo the BarTender template to use as well as the database look up value (ie your QueryPrompt1 = value). My sample file therefore looks like the below, but please note I called the date field TheDate and not MfgGate for some reason:

  • For the label format name I did not include the full path to the label or the file extension as I set these in the Integration but you could include these here. My file includes two lines of data and uses two different label formats when it prints. For your information I used a simple Excel spreadsheet rather than Access for testing as it was quicker to mock up and here is an image of that
  • You need to save a sample of you trigger file in to a folder on your PC/server for reference later

  • For my Integration I set this as a File integration with the file to be deleted once detected (as the contents of the file become part of the %EventData% variable once detected.
  • Under the Actions remove (for now) the Print Document action as we need to set this later as a child process under a different action and then use the plus icon to add a new Action and select Transform Text to Record Set
  •  In the Transform config screen use the Database Connection Setup to browse to your sample trigger file saved above, change the Source to Variable and in Variable type in EventData and your screen should look a bit like this:

 

  • Now click on the blue plus icon to add a new For Each Database Record Action. Although not necessary I added a Field Variable Name Prefix of fld to this config screen but made no other changes
  •  Now click on the plus icon to the right of the For Each Database Record and choose the Print Document action. You should see that this action title is slightly offset under the For each.... as this action is now a "child" of the action above and will run for each record in the trigger file.
  • The Print Document settings need a bit more work to configure and so I will deal with each tab individually:
  • Document Tab - Browse to find your label, it may automatically load a preview at this stage but this isn't necessary if it does not but what you do need to do is click on the Import Settings option and let it load the document settings into memory.
  • Once you have loaded the document settings, click in the Browse bar and replace name (and.or path) from the bar and click on the Insert Variable > More Variables > Actions and double click on the name in the column on the left for the field that will holder the label format name. For my screenshot below, you will see I have left the path as it is and just added the variable with a .btw after it as I did not include this in my trigger file as mentioned above.

  • Print Options - if not already correct adjust the printer name to the correct device to use. Note this could also be set as a variable in your trigger file if required as could the copies etc
  • Named Data Sources and Query Prompts - the configuration of these is basically the same. As you have already imported the label settings the named data sources and query prompt name should appear in the list when you tick the Specify Values box. Now for each of these in turn you need to create a link to the correct variable in the right hand column. This is the same process as for setting the label format to use, namely Variables>More Varaibles>Action> and then double click on the field to use. Repeat this process for all the Named Sources and the Query prompt and your screen should look like the below:

I would then suggest you save the setup and then click the Test button and make sure it all works.

I hope this helps

Pete

 

0
Avatar
Lukáš Janík
評論操作 永久連結

Hello Pete,

thank you for your reply. I tried to create a file in Integration Builder based on your instructions and everything I needed worked very well. Thank you very much. Now I know what does do function Transform text to record set and how connect another db in Integration Builder with variable fields. For each database record is great function and it is exactly what I needed connect variable fields with query prompt to choose which record will be printed.

Lukas

登入寫評論。