Contact TLCC

Notes Domino 6 feature - controlling a view column's colors

Date tip published:06/02/2003
Description:Release 6 supports a new option for columns in views called the color column. A color column can be used to display different text and background colors based on a conditional formula. This tip will show you how to create a color column to use different colors in a view column.


To learn more about the new features of Notes and Domino 6 use the following links:

Notes Domino 6 Application Development Update
Notes Domino 6 Application Development 1



Setting Column Colors using a Formula

Release 6 supports a new color column for views. A color column can be used to display different text and background colors based on a conditional formula. In the following image, notice how the Gain/Loss column displays investment gains in green and losses in red.




Procedure: Creating a Color Column

RGB (Red Green Blue) color values in a color column are used to set the background color and text color for values displayed in a view's columns. The following image shows a view design which includes a color column. The color column is highlighted and its properties and formula are displayed. The 'Use value as color' option is checked for the color column. The column's formula returns one color (red) for a losing investment and another color (dark green) for a profitable investment. Notice how the color column only controls the colors for itself and the columns to its right.



Follow these steps to create a color column in a view:
  1. Edit a view in Designer. Insert a new column to the left of the columns whose colors you want to control.
  2. In the column properties dialog, check the 'Use value as color' option.

    Also, check the 'Hide column' option on the Advanced tab to hide the color column. The color values still apply to all columns to the right of the hidden color column.
  3. Add column formula to return a RGB color value as a numbered list, with each RGB value separated by a colon ( : ). A conditional formula can be used to display different text and background colors based on a condition.

Setting Text and Background Colors in a Column

The color column formula returns a RGB color value as a numbered list, with each RGB value separated by a colon ( : ).

Text Color Only

To control just the text color, return a single set of RGB color values. For example, this color column formula applies blue text (Red=0, Green=0, Blue=255) for all columns to the right of the color column.
0:0:255

Both Background and Text Color

The background color of a view's column can also be controlled. The image below shows a view in which the first column of the view has the following formula:


    @If( @Contains(PartName;"Ladies") ;
    255:193:253:255:0:0;
    0:0:255)

This produces the following view.


To control both the text color and the background color, return two sets of RGB color values, with the background color values listed first. For example, this color column formula applies red text (Red=255, Green=0, Blue=0) on a light pink background (Red=255, Green=193, Blue=253). Notice how the RGB values for the background color are listed before the RGB values for the text color.
255:193:253:255:0:0


Tip
Tips for Setting Column Colors using a Formula

Consider these tips when using color columns:

  • Hide the color column. Check the 'Hide column' option on the Advanced tab to hide the color column.
  • Color column values apply to the color column and all columns to the right of the color column. To apply colors to columns on the left side or in the middle of a view, use a second color column to "turn off" or reverse the color settings from the first color column.
  • Use the Color Picker, available in most properties dialogs in Designer, to determine the RGB values for colors.

    This image shows how the RGB values can be determined for the selected gray color. Notice the RGB color values at the top of the Color Picker.