Friday, May 8, 2015

BIRT Reports error - "The following visibility expression does not evaluate to a legal boolean value"

Just a quick one for today. After runnign ahandful of my reports today, I noticed the following error in my print preview:

"The following visibility expression does not evaluate to a legal boolean value: {EXPRESSION}"

After thinking it through a little bit today, I realized that I had not included an else statement to my expression. Here's an example

    If(myElement.value = '0') {true}

This seems like a newbie issue, but before today, BIRT seemed to just handle it without a peep. Now it seems that I have to include an else expression. Simply changing it to this fixes the error:

    If(myElement.value = '0') {true} else false



If you're okay with changing the XML document, you can simply do a a quick find and replace:

Find: ) {true}
Replace: ) {true} else false


Then save the document and regenerate the report.

No comments:

Post a Comment