On 10/23/2013 04:18 AM, Alex Thurgood wrote:
On 23/10/2013 13:08, Alex Thurgood wrote:
On 23/10/2013 03:59, Girvin Herr wrote:
This should do it :
IF(LEFT([selected])="t";"\u2612";"\u25A1")
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]"✔";[=0]"";""
(The ✔ 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
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.