Is there a way to color a column using DXL? - ibm-doors

When I manually click the column properties there is an option to set column Text Color by attribute, and there is an option to set Background Color by attribute. I want to do this through DXL instead of manually.
I've found the DXL function that sets the Text Color by attribute: color(Column c, string AtrrName).
However, I'm unable to find the function that sets the Background Color in the DXL Reference Manual. Is there a function for this?

Yes, it is in the section "Columns", page 688.
backgroundColor(set)
Declaration
void backgroundColo[u]r(Column c, string enumAttrName)
Operation
Sets the attribute enumAttrName as the background color for column c.
Example
Column c = column(1)
backgroundColor(c, “enumAttrName”)
Sets the background color for column c to use attribute enumAttrName.
Column c = column(1)
backgroundColor(c, “”)
Removes any previously configured background color attribute for column c.
It's new for DOORS 9.6.1

Related

Google Sheets Conditional Format for Multiple Columns

I am using google sheets. For column E, under the header “Received” I have formatted it so that when you type in "no" the color of that cell turns red. But when you type in “yes" then the color of the cell will change to green.
How do I get column F (column to the right of Column E, under the header “Total”) to automatically display the number "20" AND also the make it’s cell
turn to green whenever the cell next to it, in column E says "yes"? And if I type in “no” in Column E id like the cell next to it in Column F to say “0” and the background color change to red.
Please help!
I asked ChatGPT it said to use the formula =IF(E2=“yes”,”20”, “”) however this didn’t work. It only changed column F background color to green but it didn’t change the cell to say “20”
These are two separate things. One is the formula inside the cell that determines the value of 20 or 0
=IF(E2="","",IF(E2=“yes”,20,0))
Or you can set it as an array formula in F2 to expand to lower rows. Put this in F2:
=ArrayFormula(IF(E2:E="","",IF(E2:E=“yes”,20,0)))
Other thing is the conditional formatting rules that set the colours. Select F2 column and choose conditional formatting. Look for custom formula and you can use:
=E2="yes"
=E2="no"
For green and red respectively. Try these things and let me know
I was able to to get it right using the formula =IF(E2="yes", "20.00", "0.00").
That did the trick, and to change the colors I did conditional format and set it to Text contains: 20and changed the color to green. I added another rule except this time I put Text contains: 0.00 and changed the color to green.

Conditional Formatting Pivot table in Google Sheets

In the example picture, I have a basic conditional format set to highlight the words Home and Home Connect.
I am looking for a formula or query that will dynamically extend the conditional format colour to fill the blank cells in the column to group all the Home topics. as well as the word without formatting the entire row or column.
Since new data will be added the solution should work for the entire column.
Something like highlight all cells under Home until not null.
Maybe another one that highlights all cells under Home Connect until not null.
Although this post is a bit old: the easiest and "cleanest" way to accomplish this IMHO is to "repeat row labels" and use conditional formatting to achieve the desired coloring:
If you don't mind the repeating values in the first column, you're actually already done by just activating the checkbox in your pivot table settings using your existing conditional formatting (as in the red "Home Connect"). If it bothers you, you can add another conditional formatting to make the repeating text "disappear" (as in the yellow "Home").
The conditional formatting rules to hide repeating values is:
Custom Formula:
=and(offset(A1,-1,0)=A1,A1="Home")
This checks for two things:
a) is the value equal to the value above it?
AND
b) is the value "Home" ?
=> If both are true, we'll color both background and the font in the same yellow-tone.
The other ones are self-explanatory I presume.
If you want to hide the red text as well you'd just need another custom formula rule for "Home Connect", coloring both text and backround in red.
Obviously you can also "dim" the repating text by using a slightly different yellow / red tone for the text in your custom formula conditional formats:
Approach
The goal here is to build a pattern matching that will result in custom cell formatting.
_
| KEY , value
| _
1_| | / , value
| 2_| / , value
| |_
|_
I think it would be better to use a programming language to express this pattern matching feature.
The idea is to build a Map that holds the Keys and the colors. Then you can loop through the columns and check for the pattern and set the background color accordingly:
// In this case a custom menu is added to trigger the validation any time you want.
function createMenu() {
SpreadsheetApp.getUi().createMenu('Custom Formatting').addItem('validate pattern', 'validatePattern').addToUi();
}
function validatePattern() {
let ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
let rows = ss.getRange("D1:E").getValues();
let map = new Map();
map.set('Home', 'green');
map.set('Home Connect', 'red');
//Set new (key,color) entries to tune your pattern matching.
let color ='';
for (let i in rows) {
if (map.has(rows[i][0])) {
color = map.get(rows[i][0]);
}
if (color != '' && rows[i][1] != '') {
ss.getRange(`D${parseInt(i)+1}`).setBackground(color).setFontWeight('bold');
} else {
color = '';
}
}
}
Reference:
Javascript Map
Class Range
Spreadsheet Menu

FileMaker Pro TextColor as a calculation for a field in a table

I have a list of colors that we use and I am creating an app where I am storing the RGB values of those colors in 3 fields R, G & B. Then I have another text field in which I used this ██████ Unicode block of text and used a script to SET FIELD and then calculated the TEXT COLOR of this field to display the correct color as per RGB values by using script trigger whenever the RGB values are modified. Everything works well.
Now what I want to do it display all the color names and the correct color in a portal. The problem is all the RGB values are taken from the current record and so my portal shows different color names but the Unicode block of text is always in the same color. Any ideas on how can I correctly incorporate this? I tried Googling and even skimmed through the documentation of FileMaker but could not figure out a workaround.
Thanks!
It is difficult to understand your structure. If you have "a list of colors" then you should have a table of Colors, with fields for R, G, B and a calculation field for displaying the swatch - all in the same table.
A portal to such table will show one row per record - and each row will show the fields from the corresponding record, including the swatch field.
There should be no need to use any scripts or script triggers for this.

Changing cell background and foreground color with different conditional formatting rules

I'm coloring my list's background with stripped color for visual purpose, using =ISEVEN(ROW()) formula in conditional formatting.
But now I also want some cells in the list to have red text color if it contains +.
Problem is each rule tries to format both background and foreground color of a cell, and one rule would precede another.
Is there anyway to instruct a conditional formatting rule to format only background or foreground?
When you create conditional formatting rules, you can include a fill colour (or not), font colour/style (or not), and much else, for any cells where the condition(s) is met.
So, for your =ISEVEN(ROW()) simply don't include any font colour option in its rule, similarly in your contains + rule, simply don't include any fill settings in its rule
I would make an attempt at using a custom formula (within the conditional formatting drop box options) that changes the font colour based on the "+" being present in the cell.
I would use a custom formula such as:
=RegExMatch(A1, "\+")
And then format the conditional formatting to suit your text colour choice.
This should search the cells in the defined column for the "+" and then reassign your desired font colour if the "+" expression is within the cell.
NOTE: The A1 (range) dictates the column that is being scanned and will likely have to be adjusted to suit your need.
ALSO NOTE: The "\" before the "+" symbol is there to signify that the plus symbol is a "special character".
Examples of Regular Expressions

Custom Conditional Formatting formula

I'd like to use Conditional Formatting in Google Sheets to color in a whole line based on certain criteria:
Color the line red if Column D contains a specific Value AND Column L is not empty AND Column S is empty.
Color the line green if Column D contains a specific value AND Column L is not empty AND Column S is also not empty
Do not color the line if Column L is empty, regardless of whether Column D or S have values.
So far, here's what I've tried:
=$D:$D = "specificValue"
This will color in any line in which Column D contains the specific value
=$D:$D = "specificValue" & $S:$S
This will color in any line where D contains the specific value and Column S is empty. Close, but not quite what I need.
=$D:$D = "specificValue" & $S:$S <> ""
This will Color in the whole range that I am applying the conditional formatting to.
=$D:$D = "specificValue" & $S:$S & $L:$L
This will color in any line where Column D is the value, AND BOTH Columns S and L are empty. A value in either S or L will make this line not colored. This is problematic. If D AND S have values but not L then it doesn't need to be colored. If D and L have values but not S then it needs to remain colored until I have S filled in.
Please select all the relevant cells in your sheet and Format, Conditional formatting..., Format cells if..., Custom formula is enter:
=and($D1="specificvalue",not(isblank($L1)),isblank($S1))
and for Formatting style choose red fill, Done.
Then repeat with Add new rule:
=and($D1="specificvalue",not(isblank($L1)),not(isblank($S1)))
with green fill.
The formulae are a little more verbose than really necessary but hopefully make it more obvious what is happening, as I suspect you might need to make some adjustment. Note that formatting an entire sheet may be slow. You might want to turn "specificvalue" into an absolute reference to a cell containing specificvalue.

Resources