Page 1 of 1

[Solved] Conditional Print Expression or Formula

PostPosted: Sat Oct 18, 2014 9:53 pm
by nathan3553
I am using Oracle Report Builder:

I have a boolean field that I want to display a check mark(will settle for an asterisk) if the value is TRUE. If false, display nothing.
Is this possible using Conditional Print Expression or a Data Formula? What Formatting is required?

Re: Conditional Print Expression or Formula

PostPosted: Tue Oct 21, 2014 10:35 am
by Nocton
As far as I know, formatting options for Boolean fields only give TRUE and FALSE.
I do it in a Query for the report.
Code: Select all   Expand viewCollapse view
CASEWHEN( [BooleanField], 'Yes', 'No' )


Replace Yes and No with whatever text you want.

Regards,
Nocton

Re: Conditional Print Expression or Formula

PostPosted: Tue Oct 21, 2014 11:16 am
by Villeroy
The "normal" reports created without the report builder extension are simple Writer tables. When you open the report for editing (right-click>Edit) then you see a table with 2 place holder rows; first row for column labels, second row for data. Format the respective cell representing your boolean field in the second row.
This number format code shows the text "Yes" for any positive value (boolean TRUE is equivalent to +1), "" for negative numbers (does not apply) and "" for zero (boolean FALSE is equivalent to 0).
Code: Select all   Expand viewCollapse view
"Yes";"";""

Re: Conditional Print Expression or Formula

PostPosted: Wed Oct 22, 2014 10:00 pm
by nathan3553
It sounds like the answer is you cannot replace a boolean value of True with a check mark or asterisk, correct?

I'm currently already displaying True and when False, nothing.

Re: Conditional Print Expression or Formula

PostPosted: Wed Oct 22, 2014 10:10 pm
by Villeroy
Did you try any one of the 2 solutions?

[SOLVED] Re: Conditional Print Expression or Formula

PostPosted: Thu Oct 23, 2014 7:09 pm
by nathan3553
I realized what was happening. I added the CASE WHEN logic to my query, but didn't remove the conditional print expression. Once removed and format type changed to text, the BooleanField displayed an asterisk as requested.

Thanks!