[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libreoffice-users] [SOLVED?] Problem with text formatting in Report.
- Subject: Re: [libreoffice-users] [SOLVED?] Problem with text formatting in Report.
- From: Girvin Herr <email@example.com>
- Date: Thu, 16 May 2019 16:46:26 -0700
- To: firstname.lastname@example.org
I think I have a solution. I did some research on the Pentaho report generator that is used in the LO Base Report Generator with emphasis on their formula syntax. The following formula placed in the report field's properties "Data" tab in "Data field..." seems to do what I need:
This tests the length of the text string (Suffix) and if not 0 then outputs the string prefixed with a dash. The ampersand (&) concatenates text strings. If the string length is zero, it outputs the NULL string. I tried outputting the string here without the dash to be sure I got all data, as in:,
but it fails for some reason, outputting "false" when the string length is 0 instead.
As I said, it seems to be working, unless I breathe on it!
Thanks for all the suggestions.
On 5/15/19 3:17 PM, Girvin Herr wrote:
I am using LibreOffice 18.104.22.168 on Slackware Linux 14.2 (K4.4.75).
I have a database with a text field which may or may not be null. What I want to do is to prefix a dash "-" before the text if the text field is not null. At first, I tried this format:
Somewhere, not by me, it got changed to:
However, this does not work. I get the text when not null, but not the dash in either case.
Is there another way to do this?
To unsubscribe e-mail to: email@example.com
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
|[libreoffice-users] Problem with text formatting in Report.||Girvin Herr <firstname.lastname@example.org>|
- Prev by Date: Re: [libreoffice-users] No corresponding column type could be found for column 'ID'.
- Next by Date: [libreoffice-users] offline help
- Previous by thread: Re: [libreoffice-users] Problem with text formatting in Report.
- Next by thread: [libreoffice-users] Cannot get summed values in a Base report