Ask Your Question

Report Conditional Expression

asked 2020-08-03 01:41:17 +0100

gkick gravatar image

Hi all,

Win10,LO (x64) HSQL2.51

Having fun with a conditional expression in a report. Depending country invoices can be issued with prices tax included or tax excluded and the tax component is shown separately. Now I have a label I want to show if the product prices are not containing tax or hide when the prices are tax inclusive. Unlike a field the label does not have a field formula property but it has a conditional expression. Tried several combination like

IF([TaxRate] = 0;'Incluido';' ') to either show the label displaying 'Tax Included' or else show a null string Would be grateful for your thoughts, thank you.

image description

image description

so in the second image i would like to hide the Tax Included bit, how can I achieve this with a conditional expression ?

edit retag flag offensive close merge delete



This is a bit confusing. You have asked similar questions before (here)and it appears you have the answer already in IF([TaxRate] = 0;'Incluido';' '). This is if field is X then this, else that.

The possible problem is surround with quotes not apostrophes.

Ratslinger gravatar imageRatslinger ( 2020-08-03 02:00:38 +0100 )edit

Well yes and no, tried double quotes and "' '" as well, maybe its because the label actually belongs to another field ? Although it works with fields but the same syntax does not seem to work with a label.

gkick gravatar imagegkick ( 2020-08-03 03:06:08 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-08-03 03:26:52 +0100

Ratslinger gravatar image

updated 2020-08-03 03:41:16 +0100


Don't use a label. Use a regular field. Can see in my sample in this post -> Libre Data - multi-level report


In using a label, you can use the Conditional Print Expression:

[TaxRate] > 0

will only print if the test is true.

edit flag offensive delete link more


@Ratslinger Hola, Thanks a million !!! Given up on the label, using a field instead as suggested and it works beautifully. Not sure if its just my underpowered machine or me, but reports are a real pain, one step and save, Two steps or more at once and crash, constant crashes irrespective of LO version. Yet once saved things tend to be stable ? Thanks again, muchas gracias, danke

gkick gravatar imagegkick ( 2020-08-03 04:43:03 +0100 )edit


Glad it is working. Note that the conditional print is just as shown - no IF involved. It is simply a true/false test.

Ratslinger gravatar imageRatslinger ( 2020-08-03 05:00:41 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-08-03 01:41:17 +0100

Seen: 207 times

Last updated: Aug 03 '20