Print Number Of Labels From Field Value In Query 追蹤

0
Avatar
Legacy Poster

I searched various topics within a few of the forums and did not see this question asked:

 

Is it possible to take a value in a query field and use that as a way to print a certain number of labels?

Example:

 

User is prompted to enter a Sales Order number. The SQL will go out and grab SKU, Pick Location, Number of Units to be picked, Other Item data and a calculated value (units divided by carton quantity).

What we are tying to accomplish is to take the calculated field and use that to print the actual number of picking labels.

 

So for above - Order#1234

SKU ABC12

PICK LOC A1Z1B1

QTY 60

Calculated value is 60 / 6 = 10 <- this would be the number of labels we wish to print.

We are currently prompting for Order, SKU and Number of Labels but with hundreds of lines per order, this is not ideal.

 

Please let me know if this is the wrong place for this question and I will move it to the appropriate forum.

Let me know if you need additional information (such as the mock up of the template, SQL and so on).

Thanks

4 意見

0
Avatar
Ian Cummings
版主
評論操作 永久連結

Data source the copies to print quantity.  For the data source type choose a VB script - event controlled script.  In the OnNewRecord event write an expression that calculates what you wish the data source, and thus the number of labels to print, to be.
 
For example:
 
If Int(Field("MyTable.Qty",6) / 1) <= 1 Then
    value = 1
Else
    value = Int(Field("MyTable.Qty",1) / 6)
End If
    
*Note the use of "1" for the second parameter in the field function simply sets the default value of the field at design time to 1 in order to avoid annoying errors appearing when not actively connected to the DB.  We use the Int() function to ensure we get a whole number, and the If...Then statement is to ensure we get a minimum returned value of 1 for the print quantity.
0
Avatar
Legacy Poster
評論操作 永久連結

So once I get this value, how do I tie it so that the number of labels calculated by this will print automatically? I tried a couple of different methods and nothing works so far.

0
Avatar
Legacy Poster
評論操作 永久連結

I have the same problem as jcbyrdman. The property "Format.IdenticalCopiesOfLabel" is read only. How do I write a script to print multiple copies of the same label based on a database value. Ian's post shows how to calculate the quantity; how do we actually print that quantity?

 

thanks

 

Roy

0
Avatar
Legacy Poster
評論操作 永久連結

Ok, so go to the print dialog box, and click the little hand Icon next to the "copies" field... sigh.

登入寫評論。