Re: Label Page Increment
I would suggest you hide the current print all button in the event you decide you want it that way later. Create a new button and the script for incrementing by item is
dim sptr as P
dim itbl as P
dim ctbl as P
sptr = set.open_session("invoices")
itbl = sptr.invoice
ctbl = sptr.customer
iitbl = sptr.INVOICELINE
filter = "invoice_no = "+field19.value
query.filter = "flattenquery(" + filter + ")"
query.order = ""
qry = itbl.query_create()
sptr.fetch_first()
qty = iitbl.boxes
dest = table.open("labl_temp")
dest.zap(.T.)
tocnt = iitbl.boxes
WHILE .not. sptr.fetch_eof()
FOR qx = 1 TO tocnt
dest.enter_begin()
dest.Invoice_number = itbl.invoice_no
dest.Name1 = ctbl.name1
dest.Order_no = itbl.order_no
dest.Cust_pn = iitbl.cust_pn
dest.Item_no = iitbl.item_no
dest.Desc1 = iitbl.desc1
dest.Desc2 = iitbl.desc2
dest.Rhm_pn = iitbl.rhm_pn
dest.Rev = iitbl.rev
dest.Datev = itbl.date
dest.Lablx = qx
dest.Lably = qty
dest.enter_end(.T.)
NEXT qx
sptr.fetch_next()
tocnt = iitbl.boxes
qty = iitbl.boxes
END WHILE
dest.close()
sptr.close()
label.preview("Box Marking - Small@c:\temp\tmpdb\rhm invoice\labl_temp.ddd")
This script could probably be cleaned up a bit because I just modified some things in the other script rather than really thinking the whole through. Nevertheless, it works.
I would suggest you hide the current print all button in the event you decide you want it that way later. Create a new button and the script for incrementing by item is
dim sptr as P
dim itbl as P
dim ctbl as P
sptr = set.open_session("invoices")
itbl = sptr.invoice
ctbl = sptr.customer
iitbl = sptr.INVOICELINE
filter = "invoice_no = "+field19.value
query.filter = "flattenquery(" + filter + ")"
query.order = ""
qry = itbl.query_create()
sptr.fetch_first()
qty = iitbl.boxes
dest = table.open("labl_temp")
dest.zap(.T.)
tocnt = iitbl.boxes
WHILE .not. sptr.fetch_eof()
FOR qx = 1 TO tocnt
dest.enter_begin()
dest.Invoice_number = itbl.invoice_no
dest.Name1 = ctbl.name1
dest.Order_no = itbl.order_no
dest.Cust_pn = iitbl.cust_pn
dest.Item_no = iitbl.item_no
dest.Desc1 = iitbl.desc1
dest.Desc2 = iitbl.desc2
dest.Rhm_pn = iitbl.rhm_pn
dest.Rev = iitbl.rev
dest.Datev = itbl.date
dest.Lablx = qx
dest.Lably = qty
dest.enter_end(.T.)
NEXT qx
sptr.fetch_next()
tocnt = iitbl.boxes
qty = iitbl.boxes
END WHILE
dest.close()
sptr.close()
label.preview("Box Marking - Small@c:\temp\tmpdb\rhm invoice\labl_temp.ddd")
This script could probably be cleaned up a bit because I just modified some things in the other script rather than really thinking the whole through. Nevertheless, it works.
Comment