Can I make a funtion to change a color in a text, variable or rectangle, depending on a database colomn... So when the DEPARTMENT column has "DEP1", then red and when "DEP2" then green?
Yes, that is possible, provided that you have the Ultimate edition. The steps to get this configured in the designer are:
1. Open the designer and add the following function to the Functions tab of the Properties window:
s = str(dep)
if s == 'DEP1':
elif s == 'DEP2':
2. Add a variable called dep to the Variables tab of the Properties window and set its value to DEP1.
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:
Senior Software Engineer
"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)