Advanced Scripting For Products
Hello,
I am fairly new to using BarTander. I am designing a bar code label that will be used to track products that we ship to our customers. We have containers that can carry a certain number of products but our orders are not always perfect matches to the container size. Example: we have to make 100 bags of product but only 40 fit in a bin. I would like to have the software print 2 labels that display "Bin 1 40 each" and then "Bin 3 20 each". I tried setting up a VB script to run at print time with the loops necessary to figure out if there is a remainder or not and then send it to a variable. I can't get the script to run properly in the program, or if this is even possible. Any help is appreciated. Let me know if any more details are needed.
Thanks
JKirkwood
I am fairly new to using BarTander. I am designing a bar code label that will be used to track products that we ship to our customers. We have containers that can carry a certain number of products but our orders are not always perfect matches to the container size. Example: we have to make 100 bags of product but only 40 fit in a bin. I would like to have the software print 2 labels that display "Bin 1 40 each" and then "Bin 3 20 each". I tried setting up a VB script to run at print time with the loops necessary to figure out if there is a remainder or not and then send it to a variable. I can't get the script to run properly in the program, or if this is even possible. Any help is appreciated. Let me know if any more details are needed.
Thanks
JKirkwood
0
-
Shotaro Ito
★ BarTender Hero ★
Hi JKirkwood,
Do I understood that - like this?
input 100
Label1: Bin 1, 40 each
Label2: Bin 2, 40 each
Label3: Bin 3, 20 each
input 12
Label1: Bin 1, 12 each
input 80
Label1: Bin 1, 40 each
Label2: Bin 2, 40 each
Mmm.
I would use print time user prompt to input number.
1.Create a text , give Sharename "QTY" then serialize the number decrements by 40. Enable user prompt.
(Place this text off-label if you don't want it to get printed)
2.To create desired copy of labels,
In Print dialog > Quantity > Number of serialization > Option, set by datasource.(Datasource tab popped up.)
On Datasource tab, select VB Script. Set multi-line script as
[code]Value = Fix(QTY / 40)
If QTY Mod 40 > 0 Then Value = Value + 1[/code]
3.To create text to show number of products in each bag,
Create a text and set datasource as VB Script. In Multi line script,
[code]
Value = 0 + QTY
If Value > 40 Then Value = 40 [/code]
(0 + QTY means treat shared substring QTY's value as number.)
4.To create number of bags, just create a text and enable serialization. Disable update sub-string after print.
(If you get Qty from database rather than user prompt, you need to reset number of bags by "OnNewRecord" event control script.)
The procedure's somewhat cryptic so I attached format. Perhaps more simple way of doing this.
[attachment=35:PopulateNumber.zip]
Hope it helps!0 -
Legacy Poster
★ BarTender Hero ★
First off....sorry for posting in 2 different threads. I wasn't sure anybody would post in the original because of the spammer. Thanks for taking care of that.
Is there any documentation specifically about the serialization feature? I figured that might be the way to go but I was not sure. I appreciate the explanation and the example code. I will try it out and report back. I have been looking all over for some sort of in-dept tutorial or learning series videos that go into more detail about the advanced features of the product. After setting this up, I may just put a set together my self. Again, thanks for the help.
Jkirkwood0 -
Legacy Poster
★ BarTender Hero ★
I set the serialization up as explained and the thing works perfectly. I appreciate all the help.
Thanks
Jkirkwood0 -
Legacy Poster
★ BarTender Hero ★
Shotaro,
Is there a way to have the user input the amount per bins if they are not a standard amount?
Thanks
Jkirkwood0 -
Shotaro Ito
★ BarTender Hero ★
Hi Jkirkwood,
Unfortunately increment/decrement value of serialization cannot be specified by prompt / script, so you need different approach.
Probably you would need to specify number of Identical copies rather than serialized copies.
In Event control script's OnIdenticalCopy event, you can increment / decrement value.
However I say there's some more difficulty - I couldn't reliably get "each" amount.
Perhaps create another format to cover bin size 30 etc would be more simple solution.0
Please sign in to leave a comment.
Comments
5 comments