Control Printing Of Shapes Based Od Data Follow

0
Avatar
Legacy Poster

Hello,

 

I am evaluating BarTender to see if it can accomplish the following tasks:

 

  • I need to control the printing of an up or down arrow based on the data for the label containing a certain character
  • Similarly, I need to control the printing of a left or right arrow based on the numeric portion of the data for the label being odd or even

I've searched the forums and found links to the "Dynamically Changing Objects at Print Time using VB Script" whitepaper. The section on On-the-fly Modification of Object Properties seems to be exactly what I am looking for. It states:

 

"A common use case for this feature would be to change object’s in response to the data coming from a database. In this case you would write a script for the OnNewRecord event. You could change the color of a text object, depending on whether or not a warning condition was indicated. For example, you could write the following script for the OnNewRecordEvent.

 

Set Notice = Objects(“Notice Text”)

If (Field(“Condition”) = “Warning”) Then

  Notice.TextColor = btColor.Red

Else

  Notice.TextColor = btColor.Green

End If

 

I am using the latest demo in Automation mode. My data source in an Excel spreadsheet with a single column of data called "DATA". My label prints the barcode and text data correctly. The missing piece is the direction of the arrorws.

 

My OnNewRecord even script is as follows:

 

'Executes during printing, after reading a database record.

'set object references
Set objUpArrow = Objects("UpArrow")
Set objDownArrow = Objects("DownArrow")

'grab data from data source
strVal = Trim(Field("DATA"))

'set visibility based on data
objUpArrow.PrintVisiblity = Not (InStr(strVal, "A") > 0 )
objDownArrow.PrintVisiblity = (InStr(strVal, "A") > 0 )

 

 

When I click the Test button in the Script Assistant, I get the following error:

 

"The following script error was found: OnNewRecord(Line 11):: Object doesn't support this property or method: "onjUpArrow.PrintVisibility"

 

 

Any help would be appreciated. Also, if there is a way to accomplish the above tasks using the Pro version instead of the Automation version, I would also be insterested in finding out how. The labels will only be printed once every 2-3 years on a single PC/Printer by a single user. I would not be getting much value from purchasing the Automation version.

 

TIA

 

 

 

 

 

 

3 comments

0
Avatar
Legacy Poster
Comment actions Permalink

Never mind... It works perfectly. Typo was PrintVisibity instead of PrintVisiblity...

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

Cool -- good job!

0
Avatar
Legacy Poster
Comment actions Permalink

They only way I see you getting away with using Pro for this is to have each arrow and color be it's own "graphic" that is swapped in and out based on the data from another field. It's most likely doable but not as slick as your script programatically changing object properties.

Please sign in to leave a comment.