Script to Change the Color of a Line
Description
When you want to change the color of a line based upon a different field, use the script described in this article.
A Script to Change the Color of a Line
Changing the color of a line can be done with the following script, using multiple colors of the same line stacked directly on top of each other. The script will then turn the printing capability of the line color by comparing the value of a user entered field to the line color required. The script is shown below, with the sample label attached.
Script Line Color Change.lwl
//Define the variable that will be used to decide which color line to display
var input1 = String(label.fields.field.(@name == 'Color').@data);
//Define the if-else statement that will decide which color line to be printed
if (input1=="Red")
{
//print field
label.fields.field.(@name =='Red').@printingField = true
}
else if (input1=="Green")
{
//print field
label.fields.field.(@name =='Green').@printingField = true
}
else if (input1=="Blue")
{
//print field
label.fields.field.(@name =='Blue').@printingField = true
}
Article Number
2016008
Versions
Loftware Label A label is a design area on the computer screen where a label format is created or edited. Manager / Loftware Print Server versions 9.5.2.0 - 11.1
Environment
All supported environments