goral Posted April 2, 2003 Posted April 2, 2003 Hello! I'm wondering if anyone has the solution to an issue we have with printing labels. We have "shipping database" in which we create "delivery receipt" and print labels. Labels have fields from "delivery receipt". One of the fields is "Number of Boxes" which is printed on the label. For example: if we have item which consists of 7 boxes label will print "Box ____ of 7". "7" being the "Number of Boxes" field. Then we print 7 labels using thermal printer and write in with pen Box #. Question: Is there a way to print labels where FM will calculate which label is being printed and prints it on the label, example: "Box 1 of 7", "Box 2 of 7" etc. Thank you for any feedback I can get. Sincerely, Peter Shipping_.zip
danjacoby Posted April 2, 2003 Posted April 2, 2003 I answered this very question just three days ago; unfortunately the person who posted it didn't give the post a good title (otherwise you would have found it), so here it is again: You could create a script that temporarily creates new records for shipping purposes: First, create a "LabelNo" field that returns a number, and have it auto-enter a "1". Now create a global field ("gLabelNo") that returns a number. Finally, create a calc field, "ShippingLabelInfo", with the following calc: LabelNo & " of " & BoxesNo (Note the spaces on either side of the word "if") Finally, perform a find for all records where LabelNo > 1 (yeah, you might want to create a phony record first). Now the script (BTW, I'm calling the field where the number of boxes is entered "BoxesNo"): Show All Omit Record Show Omitted (So far, we've set things up to be just the current record) If BoxesNo > 1 Set Field (gLabelNo, 2) Loop EndLoopIf (LabelNo = BoxesNo) Duplicate Record Set Field (LabelNo, gLabelNo) Set Field (gLabelNo, LabelNo + 1) End Loop (Now we have one record for each label) Print Perform Find (Restore, Replace Found Set) Delete All Records (No Dialog)
goral Posted April 2, 2003 Author Posted April 2, 2003 I know it's a stupid question but what "BTW" stands for? P.
LiveOak Posted April 2, 2003 Posted April 2, 2003 BTW - By the Way OBTW - Oh, by the way IMHO - In my humble opinion (my favorite) -bd (Brent Dussia)
danjacoby Posted April 2, 2003 Posted April 2, 2003 Non to mention LOL and ROFL, which don't show up often in these boards, but maybe they should. For those uninitiated, that's "Laughing Out Loud" and "Rolling On the Floor Laughing". BTW, IMHO would be my favorite, but I'm never humble.
goral Posted April 3, 2003 Author Posted April 3, 2003 Thanks for your help, but I had a problem creating this script. Below I placed a copy what you've wrote with my notes. Thanks again. Peter. *********************************************************** Show All Omit Record Show Omitted (So far, we've set things up to be just the current record) If BoxesNo > 1 Set Field (gLabelNo, 2)***** how do you enter ",". I couldn't find that seperator. Loop EndLoopIf (LabelNo = BoxesNo)*****is it supose to be "ExitLoopIf" cause there is no "EndLoopIf" Duplicate Record Set Field (LabelNo, gLabelNo))***** how do you enter ",". I couldn't find that seperator. Set Field (gLabelNo, LabelNo + 1))***** how do you enter ",". I couldn't find that seperator. End Loop (Now we have one record for each label) Print Perform Find (Restore, Replace Found Set) Delete All Records (No Dialog)
jasonwood Posted April 3, 2003 Posted April 3, 2003 You don't enter the comma, it just separates the two parameters that you configure at the bottom of the Scriptmaker window. ExitLoopIf sounds right BTW: since you are using a label printer, you could avoid this alltogether if you don't mind sending separate print jobs for each label... You'll need two global fields: one for the number of labels you want to print (qtyPrint), and another for current label number (labelNumber). You can put both on your layout, eg: <<labelNumber>> of <<qtyPrint>> remember to set the qtyPrint field to the number you want to print, then do this: If (qtyPrint < 1) Show Message ("You can't print less than 1 label!") Else Set field (labelNumber, 1) Loop Print [no dialog] Exit Loop If (qtyPrint = labelNumber) ****there are no more to print Set field (labelNumber, labelNumber + 1) ****increment labelNumber by 1 End Loop End If
Recommended Posts
This topic is 7896 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now