How do I change font color based on a database field?

How do I change font color based on a database field?

1. Open the designer and add the following function to the Functions tab of the Properties window:
def depcolor(dep):
  s = str(dep)
  if s == 'Name of Department 1':
    return 'Red'
  elif s == 'Name of Department 2':
    return 'Green'
  else:
    return 'Black'
2. Add a variable called dep to the Variables tab of the Properties window.

3. Select the DEPARTMENT column in the Data tab on the left-hand side of the main window, drag it to the Variables tab in the Properties window and drop it in the value text box of dep (in version 7.0 drag-and-drop is not available and you have to map the variable in the mappings window after finishing the steps below).

4. Select the text object whose color you want to control and go to the Expressions tab of the Properties window.

5. Type in the expression box for the Foreground property the following expression:
depcolor(dep)
    • Related Articles

    • How do I transfer CardExchange Producer Software to a new PC?

      If you are looking to transfer your installation to a new PC, then you can follow the below steps:   Install CardExchange® Producer or TrustID on the new PC Copy the Data directory from the old PC, by default this is located in the following location ...
    • How do I use a custom color profile for my Evolis printer?

      Open the “Control Panel” and select “Devices and Printers” Right click on your Evolis Printer and choose “Printer Properties” Select the “Color Management” Tab Click on the “Color Management” button. Select your Evolis printer from the drop down menu ...
    • How do I convert .ced files to .cedx?

      Go to the configuration tab, advanced options, then check the box for “SHOW MIGRATE BUTTON OR MENU” and “SHOW ADVANCED MAPPINGS” if you want to use the old designer ensure that “USE  VERSION 7 DESIGNER” to manage the old .CED files within version 9 ...
    • How do I download CardExchange Gateway?

      Standard Trial: https://downloads.cardexchangesolutions.com/cegateway.exe FULL download (includes MySQL Server, etc.): https://downloads.cardexchangesolutions.com/cegatewayfull.exe
    • How do I backup or transfer my Jolly Technologies Software?

      Software Backup and Transfer Instructions: Each Jolly software license can only be installed on one computer at a time. (Once the software has been activated on the new machine, pushing the backup over the new installation should restore the settings ...