Custom Background Color Follow

0
Avatar
Legacy Poster

Using BarTender 2016 EA.

 

The company wants to print color bars on the labels, with the colors read from the database.

 

Working in the OnSerialize event,

 

This works:

myR=42
myG=38
myB=49
Format.Objects("boxLabelColor").FillColor  = BtColor.FromRgb(myR,myG,myB)

 

 

 

This does not work:

myR=Format.NamedSubStrings("ds_R").Value
myG=Format.NamedSubStrings("ds_G").Value
myB=Format.NamedSubStrings("ds_B").Value
Format.Objects("boxLabelColor").FillColor  = BtColor.FromRgb(myR,myG,myB)


The indicated error is "Type Mismatch: 'BtColor.FromRgb'

 

 

How do I get data-driven color bars?

 

Much appreciation in advance.

  

 

Okay, more info after taking the night to clear my head.

 

It works.

At least in the Print Preview.  (It's Sunday morning, and I'm 30 miles away from the printer, so can't test that.)

 

In the Script Editor window, the Named Data Sources were returning null values, which causes the error WHILE EDITING.

Once actually printing, it works correctly.

 

Changing the script for the Named Data Sources to return a non-null/empty value if no data is found (i.e. while editing) cleared up the Type Mismatch error while editing, too. 

1 comments

0
Avatar
Adam Flores Sr
Comment actions Permalink

This question was posted 5 years ago,

Did you find the answer to your question?

I have a format that changes the fill and border color of a rectangular box

based in the Items Size. (depending the SIZE, color changes to GREEN or RED or PURPLE, Etc...)

Let me know if you still need the solution.

Regards.

Adam Flores Sr.

Progressive Label, Inc. 

 

Please sign in to leave a comment.