Report Conditional Expression

Hi all,

Win10,LO 6.4.5.2 (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 ?

Hello,

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.

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.

Hello,

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

Edit:

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

[TaxRate] > 0

will only print if the test is true.

@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,

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