Changing Base report boolean representation

Greetings,
Linux LO 3.6.7.2.
I am working on my MySQL Base reports with Report Builder. The default output of a boolean value is TRUE/FALSE. Is there a way to change this to a check mark or X for TRUE and blank for FALSE?
All the FALSEs clutter up my reports, making the TRUEs hard to see in the forest. The forms use a check mark widget, which would be ideal.

Since I am using queries for the report sources, I would entertain some SQL coding for a solution, if that is the best solution and someone could point me in the correct direction.
Thanks.
Girvin Herr

Hi Girvin,

Linux LO 3.6.7.2.
I am working on my MySQL Base reports with Report Builder. The default
output of a boolean value is TRUE/FALSE. Is there a way to change this
to a check mark or X for TRUE and blank for FALSE?
All the FALSEs clutter up my reports, making the TRUEs hard to see in
the forest. The forms use a check mark widget, which would be ideal.

A partial workaround, because I haven't found a way to insert unicode
characters into a number formatted field control :

In Report Edit Mode, bring up the Properties of the control you want to
change.

On the first tab "General", set Formatting to Number - General.
On your Data tab :
Data Field Type : Field or Formula

Data Field : select your boolean field

When you now save and run the report, you will get '1' and '0' instead
of 'True' and 'False'

Alex

Or you could test the first character in the string :

IF(LEFT([selected])="t";"X";"O")

this replaces "True" (since it starts with the letter 't') by the letter
X and anything else with the letter O.

Alex

This should do it :

IF(LEFT([selected])="t";"\u2612";"\u25A1")

Alex

And remember to change the formatting to "Text" in the General tab of
the corresponding control's properties.

Alex

Alex,
Thanks for your help in pointing me in the correct direction to solve my report Boolean representation problem.

Using your direction, I finally got this to work - sort of. I used the "Formatting" option in the field properties' "General" dialog. I checked the MySQL query output for a Boolean field in my table and it returns "0" or "1" as the result. So, I verified the report field's "Data" tab "Data Field Type" is set to "Field or Formula" and the correct Boolean field is selected for the data from the query in "Data field". I then, under the "General" tab, used the field properties "Formatting" option to select a "User-defined" Category and then in the "Format Code" field, I entered:

[=1]":heavy_check_mark:";[=0]"";""

(The :heavy_check_mark: is code U+2714, which is in Liberation Sans / Symbols / Dingbats (U+27xx).)
This should output the check mark when the data is 1, and null fields when the data is 0 or anything other than 0 or 1.

I had to use the character map utility to copy the check-mark to the clipboard and then insert that character into the expression with Ctrl-v. Note that the "\u2714" construct did not work in this case. All I got was the "\u2714" text in the report. I even tried \U2714, \U+2714, etc. to no avail. Also, for some reason the "[=0]" test part of the equation does not do what I expected according to the help (bug?). It seems to be ignored and the default (the last node after the 2nd ";") gets executed instead. In fact, if I leave off that last default field, LO postpends a "General" option to take its place and it then prints the "0" false data. These anomalies are why I said "sort of" above. Note that this expression works since the value is a number (0 or 1) and I am using the number format "wired-in" LO constructs. I have not tested it with a text field and the number field constructs may not work for text.

Note that I did not use the boxed symbols you suggested, since I did not particularly want the boxes, just the check-mark. I found them all in the Liberation Sans font, but decided to stick with the unboxed check mark. I did try the boxed versions you suggested and they did work using the character map utility to insert them.

Thanks again for the help. This will clean up my reports nicely.
Girvin