Selecting Print Doc Based Off Variable? フォローする

0

Hello All, I'm new to the forums here and i'm in desperate need of some assistance. Is there a way to make bartender print a specific document based off of a variable?

I have a trigger set to read input from a COM port (shipping weight scale).
If the weight is between 18-19lbs then print document 1.
If the weight is between 19-20lbs then print document 2.

I cannot figure out how to do this, is bartendar capable of doing this? I know i can select just the one document to come out of but is it possible to give it a range to check and validate from then if so print doc 1 or 2.

Pleaseeeeee & thank you!

Adam

1 コメント

0
Avatar
Ian Einman
コメントアクション Permalink

BarTender 10.0 and later support multiple templates within a single document.  It is possible to set a print condition on a template, that evaluates when a given data source is "True".

 

You could do the following:

  • Create two templates on the Templates tab of Page Setup.
  • Create a text object, placed outside of the label bounds.  Set the data to a VB Script data source, and check the weight against the condition "Weight >= 19" or whatever the condition is.  Give this data source a name, like "LessThan19".
  • Create a text object, placed outside of the label bounds.  Set the data to a VB Script data source, and check the weight against the condition "Weight < 19" or whatever the condition is.  Give this data source a name, like "GreaterThan19".
  • Set the condition for one template to print when "LessThan19" is true, and the other template to print when "GreaterThan19" is true.

If you're using 9.4 or earlier, it gets more complicated.  You may be able to do it inside of Commander using XSLT, generating a different BTXML file when the weight is under 19 vs. over 19.  XSLT transforms do support conditional statements, but setting this up borders on rocket science.  Please let us know if 10.0 is a viable option first.

サインインしてコメントを残してください。