Print Lot Or Serial Using The Same Field
I'm not a programmer so so bare with me. I have a label and I need to save real estate on the label. Our items have either a lot or a serial but never both. I map my templates to delimited text files. Is there a way to read the text file and look for a value in the lot field, if a value is found print the Lot label and lot value, if the lot field is blank check for a value in the serial field of the text file, if there is a value in the serial field print the Serial label and serial value, if serial field is blank print the Lot label and NA as the value.
Thanks for your help!
Richard
-
When you say that you want to print the lot or serial label, I assume you are referring to a label next to the data the tells the user what type of data is being displayed. If so, create a text object and make it a named data source. I used "DataTitle."
Link the Bartender document to your delimited text file. My code below uses column names of LotNumber and SerialNumber for the data so change it to whatever you call your data.
Then create another text object that will display the data. Give it a data source type of multi-line script and try this:
If Field("LotNumber") <> "" Then
DataTitle.Value = "Lot #"
Value = Field("LotNumber")
ElseIf Field("SerialNumber") <> "" Then
DataTitle.Value = "Serial #"
Value = Field("SerialNumber")
Else
DataTitle.Value = "Lot #"
Value = "N/A"
End If
End If0
Please sign in to leave a comment.
Comments
1 comment