[Solved] Conditional Print Expression or Formula

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
nathan3553
Posts: 17
Joined: Sat Oct 18, 2014 6:35 pm

[Solved] Conditional Print Expression or Formula

Post 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?
Last edited by nathan3553 on Thu Oct 23, 2014 7:09 pm, edited 1 time in total.
OpenOffice 4 on Windows 7/OpenOffice 4 on MacOSX
Nocton
Volunteer
Posts: 539
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Conditional Print Expression or Formula

Post 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

CASEWHEN( [BooleanField], 'Yes', 'No' )
Replace Yes and No with whatever text you want.

Regards,
Nocton
OpenOffice 4.1.16 on Windows 10 & 11
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Conditional Print Expression or Formula

Post 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

"Yes";"";""
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
nathan3553
Posts: 17
Joined: Sat Oct 18, 2014 6:35 pm

Re: Conditional Print Expression or Formula

Post 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.
OpenOffice 4 on Windows 7/OpenOffice 4 on MacOSX
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Conditional Print Expression or Formula

Post by Villeroy »

Did you try any one of the 2 solutions?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
nathan3553
Posts: 17
Joined: Sat Oct 18, 2014 6:35 pm

[SOLVED] Re: Conditional Print Expression or Formula

Post 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!
OpenOffice 4 on Windows 7/OpenOffice 4 on MacOSX
Post Reply