[Solved] Conditional Formatting Using Report Builder

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
Mokonzi
Posts: 5
Joined: Tue Feb 10, 2015 7:30 pm

[Solved] Conditional Formatting Using Report Builder

Post by Mokonzi »

I'm trying to get the Report Builder to format a field based on the contents of another two fields, but no success. I'm struggling to understand how the syntax works for it.

I need one field that is true and another that is false to trigger setting the formatting to italics. Can anyone post any suggestions on the syntax I need to use?

Many thanks.
Last edited by Hagar Delest on Thu Mar 26, 2015 5:09 am, edited 1 time in total.
Reason: tagged [Solved].
Mokonzi

OpenOffice 4.1.1 on Windows 7
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Conditional Formatting Using Report Builder and Expressi

Post by F3K Total »

Hi,
e.g. Expression is:

Code: Select all

AND([B1];NOT([B2]))
See example.
R
Attachments
Report_conditional_formatting.odb
(24 KiB) Downloaded 554 times
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
Mokonzi
Posts: 5
Joined: Tue Feb 10, 2015 7:30 pm

Re: Conditional Formatting Using Report Builder and Expressi

Post by Mokonzi »

Awesome. Thanks for the help matey. :)
Mokonzi

OpenOffice 4.1.1 on Windows 7
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Conditional Formatting Using Report Builder

Post by mihmih »

Maybe someone can help me...

What will the code be if I would like to change the color of one column if another column is equal to 'aaa' or her value is TRUE

for axample, TRUE([column2]) in conditional formating of column1 does not working....
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Conditional Formatting Using Report Builder

Post by Villeroy »

In a database you can not have 'aaa' or TRUE in the same column. Either you have strings or booleans in the same column but not both.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Conditional Formatting Using Report Builder

Post by mihmih »

Yes, i know.

I want to change the color of one column if another column is equal to 'aaa' . If this is not possible, i can change 'aaa' in a source of query to boolens.
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Conditional Formatting Using Report Builder

Post by Villeroy »

Open the example database provided by F3K Total.
Right-click>Edit the report.
Select the field with content =N
menu:Format>Conditional...
Expression is (not "value is"):

Code: Select all

AND([B1];NOT([B2]))
This expression returns True if the value in the column named B1 is True AND the value in the column named B2 is NOT True, in short: if B1 AND NOT B2.
This is aalmost exactly what you want.

Select the field with content =B1
menu:Format>Conditional...
Expression is (not "value is"):

Code: Select all

[N]='BBBBB'
and add some visible formatting attribute.
This most simple expression fails to apply some color to field B1 where the text in N equals BBBBB
This feature looks very much like Calc's conditional formatting but with column names in brackets instead of cell addresses. Spreadsheet formulas put literal strings in double-quotes.

Code: Select all

[N]="BBBBB"
This expression returns true when field N has the text BBBBB and applies my formatting to the selected field B1.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Conditional Formatting Using Report Builder

Post by mihmih »

That's exactly what I meant, thank you for the perfect explanation.
LibreOffice 4.2 on Windows7
Post Reply