Conditional Printing Of Some Fields フォローする

0
Avatar
Legacy Poster

Hi, Is there a way to conditionally print a specific field in the bartender?

here's the situation, we are using a template to print labels. currently, we are using a Data Matrix type of barcode.

then, one specific customer decided that they would need a QR Code type in their label.

 

Is there a way to do this based on the info from the source database such that when the bartender detects that customer is equal to this specific code, it will print a QR Code otherwise it will print a Data Matrix type of barcode.

 

I'm using V9.2 SR2 of bartender.

To print, the Commander checks for a .csv file containing the information of the label to print and it includes the customer code.

Please help. Thanks.

3 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

This older version of BarTender doesn't support dynamic object modification.  However, you can get the result you want by stacking the two barcode types as two objects, on on top of the other.  You would then use a an OnProcessData VB script to make a conditional statement.  Set the data source of the object to nothing in order for it not to print.  Therefore based on the condition, set the data for one barcode with the data you want, and the other with an empty data source value.  An object with an empty data source will not print.

 

Here is a white paper that covers dynamic object modification in later versions:

 

http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Dynamically-Changing-Objects-At-Print-Time-Using-VB-Script.pdf

0
Avatar
Legacy Poster
コメントアクション Permalink

Hi Ian,

 

Based on the whitepaper, there should be a GHS_demo.btw in the Formats folder of Bartender, but I can't find it on mine.

By any chance, can you send me the GHS_demo.btw so that I could understand how it works.

TIA.

 

Also, I tried your suggestion on setting the data source to Nothing, but I'm encountering an error, here's my sample code:

I put this on the OnProcessData Event of Field6:

 

val1 = Format.Objects("Field1").Value

val2 = Format.Objects("Field2").Value

val3 = Format.Objects("Field3").Value

val4 = Format.Objects("Field4").Value

val5 = Format.Objects("Field5").Value


If (val2= "50") Then

Value = val1 + "$$V" + val2 + "$" + val3 + "$"+ val4 + "$" + val5

Else

Set Field6 = Nothing

End If

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

The GHS example requires v9.30 or later, you won't be able to see how it works because much of the functionality is in a feature that's not supported in your version.

 

The "value = x" expression is what sets the value of the current data source.  Note that you will be setting a string value.  Therefore your If...Then statement should look like this:

 

If val2 = "50" Then
  value = val1 & "$$V" & val2 & "$" & val3 & "$" & val4 & "$" & val5
Else
  value = ""
End If

サインインしてコメントを残してください。