Keychain expression evaluate if true?

I'm designing a report with the reports module and can't get my keychain expression to evaluate a bit type key. I have a square that I want to enable Fill if the value is True/1. I'm not sure what output a checkbox needs in order to enable it, also I'm not sure if I need to evaluate for "True" or "1" or 1.

So far, I've tried Value=="1"?"1":"0", Value=="1"?"True":"False", Value=="True"?"1":"0", and Value=="True"?"True":"0" and they all return as Fill enabled.

Thanks for the help!

Don't compare. Just use the key.

What if I wanted to use the opposite of the key? !Key?

edit: Yes, !Key is the inverse of the key.

The == syntax is for Python / Jython. It won't work in expressions.

In Expression Language = (the Equal operator) tests for equality between two operands.

This is reporting. Keychain expressions do use == for equality:

Hmmmph! How come I've never come across keychain expressions before? Am I not doing enough reports?

Perhaps. Or, like me, you compute the bits you need in SQL or your scripted data source so that all of your data key references need no expression.

I use Reporting heavily...and keychain expressions come in handy when dynamically changing text color if a value exceeds a threshold for example.

Another simple use of keychain expressions is to dynamically change the row color without the need of using row versioning. Here is a quick example.

(Row % 2==0)?"B7B7B7FF","FFFFFFFF"

image

image