Conditional formatting of a table row in Report Designer

I’d like to conditionally format rows in my table in a report based on the value in the row. My dataset has two columns, timestamp and status. If status = ‘True’ then I want to fill the background of the row. I have added a custom Alternate to my table details row and I think I need to do something with a Table Row Version Key but but I’m not sure what. I entered:
Status=“True”?“Standard”:“TrueRow” but it doesn’t seem to do anything…

Is this in the report designer, or just a regular table in a Vision Window?

in report designer

It’s easier than you think! To set the colour of a row based on a value, open the Report Designer and double-click on the ‘Data Details’ row. Click on the 4th button (used to set Property Expressions but incorrectly labelled ‘Roll, Scale & Skew’!).

Click on the ‘FillColor’ property and then type the following in the box underneath:Status="True"?"red":"white"Make sure you then press so the expression is saved against the property. You should now find all rows with a status of True should be highlighted in red. You can of course use other colours and other properties to achieve different effects.

1 Like

Thanks for the tips. It all makes sense, I tried what you suggest, but I still don’t get any fill. Project is running on a machine without internet access, I’ll take some screen shots and attach when I return to office.

You were soooo close, need a == and then it works!
Thanks

Is there a change in the latest version of report designer in 8.1? On double clicking the ‘data details’ row a property inspector appears. Where is the condition to be defined here? In the version key property? This property doesn’t seem to get saved when edited! Should we write the condition like Status=“True”?“red”:“white” etc in the text data for the particular column? But the version key property overrides it!

There is no video on this in IU tutorials. Need to see the documentation if its explained in more details there!

This post is from ten years ago, when there was no “report designer”, reports simply ran inside the scope of a Vision client.

The core principle is the same, you want to use a keychain expression, as documented in the manual and on IU:
https://docs.inductiveautomation.com/display/DOC81/Keychain+Expressions#KeychainExpressions-ConditionalKeychainExample

1 Like

Thanks a lot for the information. However, the keychain expression for the text color property doesn’t seem to work! Also, the keychain expression for the text also doesn’t work properly, though entering the expression directly in the text field within @@ works fine! But I am unable to assign color to the text based on conditions!

Also don’t understand the meaning of property “version key” in the properties for table row:

image

image
image

A dynamic data key on ‘Fill Color’ (within the actual details row) works for me.

The ‘Version Key’ property is a different way to approach styling/conditional formatting. If your actual data is already structured such that there’s a key you can use to drive alternate row version, you could populate that version key field. In your screenshot, it looks like you might be able to directly use Status as the version key.

So, for example, using the same data as above; I set Version Key to a (static!) key of Column 2:
image

Then I added a custom row version named ‘2’:
image

Thus the table uses my alternate version when the version key’s value matches the name I supplied:
image

1 Like

Thanks a lot for the detailed explanation. The ‘Fill Color’ dynamic data key is working for me also now, I had included the expression within @@, that was the mistake!

The version is property is still not clear to me, but I will read your comments again later and try to understand it.

Thanks a lot for your time taken to explain in detail.

Best Regards

Is the column name actually Column4?
I can't really speak to anything else about your setup without more information.