Subject: Category row displayed in different color - this works
Well, @IsCategory in 6.5 doesn’t do what the help says. At least when it returns a value, it’s not a string that can be evaluated as a string in any way.
Nevertheless, here is an akward method that works to color your category rows differently.
-
Put a column before all the categorized columns. This will be your color column. Check the Use Value as Color property of the column properties.
-
Use one of the functions below:
@If(@IsCategory(“any”)=“any”;any;1:1:1)
@If(@IsCategory(“x”)=“y”;z;1:1:1)
Note: in the function above, where the word “any” appears, or “x” “y” and “z”, it can be anything, matching or not. It will always evaluate to false. If you try just @IsCategory, it will error out because that doesn’t return true. And no match you try will ever cause a true comparison.
That said, the result is that all rows will be colored black if they are not categories. This overrides the default text color. If you want another color than black, then adjust the 1:1:1 accordingly (red:green:blue up to 255 for each position, red= 255:0:0)
- Now go to any column and set the text color to the row you want your categorized rows to appear in, and click Apply to All. Voila!
Quite odd that you have to jump through these hoops. It would have been much better if @IsCategory would have just returned a simple true or false (like @IsNewDoc, @IsDocBeingEdited, etc.) and then let us use @if to determine what to do with it rather than having it return an asterisk or a string that can’t be tested. Argh!!!
Here is the weird behavior of the @IsCategory function.
For example, to simply display the result of @IsCategory, all of the following three formulas display no in all rows, regardless of whether they are category rows:
@if(@IsCategory=“*”;“yes”;“no”)
@if(@IsCategory(“hello”)=“hello”;“yes”;“no”)
@if(@Text(@IsCategory(“hello”))=“hello”;“yes”;“no”)
The following formula returns an error:
@if(@IsCategory;“yes”;“no”)
The following formula displays nothing at all:
x:=@IsCategory;
x
The following formula displays the word “red” in all the category columns:
@IsCategory(“red”)
The following formula displays an error:
red:=255:0:0;
@IsCategory(red);