Using conditional formatting in OO writer

Discuss the word processor
Post Reply
onlinealien
Posts: 3
Joined: Sat Nov 21, 2015 12:08 pm

Using conditional formatting in OO writer

Post by onlinealien »

I am trying to create a Health and safety risk assessment document where I can show the severity of risk in different colors ( green, red...) in a table cell . I know this is possible in OO Calc but I am looking to use the Writer.

How is it possible to get this function working in Open office Writer?

Thank you
Open Office 4.1.1 win7
John_Ha
Volunteer
Posts: 9600
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Using conditional formatting in OO writer

Post by John_Ha »

Welcome to the forum.

If you search Help with conditional you will see what can be done with conditional formatting. For example, Defining Conditions says:
Conditions are logical expressions that you can use to control the display of fields and sections in your document. Although the following examples apply to fields, they also apply to sections.
You can define conditions for the following field types:
1. Conditional text: displays text A if the condition is true, or text B if the condition is false.
2. Hidden text: hides the content of the field if the condition is true.
3. Hidden paragraph: hides the paragraph if the condition is true.
4. Any record and next record: controls the access to database records.
...
One way might be to have three fields, one red, one orange, one green. Now hide the two not needed, and show the third according to the condition.

Also see Developing conditional content on pp 397 of the Writer Manual

If this solves the problem, please click the Edit button on your original post and edit the Title to [Solved].
Last edited by John_Ha on Sat Nov 21, 2015 12:51 pm, edited 2 times in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 35064
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Using conditional formatting in OO writer

Post by RoryOF »

There are some suggestions on the use of conditional formatting in Writer on this (and subsequent) page
http://www.linuxtopia.org/online_books/ ... tyles.html
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: Using conditional formatting in OO writer

Post by jrkrideau »

For a health and safety document don't forget to allow for colour blindness. http://designshack.net/articles/accessi ... ind-users/
LibreOffice 7.3.7. 2; Ubuntu 22.04
User avatar
RoryOF
Moderator
Posts: 35064
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Using conditional formatting in OO writer

Post by RoryOF »

There is further information on Conditional styles in Writer at
https://www.linux.com/learn/tutorials/3 ... ice-writer

I admit that this is new to me. I must brood on what use I can make of it.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Using conditional formatting in OO writer

Post by acknak »

I don't think this is possible in Writer. I don't know of any way to connect a formula to text formatting or a table property.

Conditional styles allow a style to be associated with certain situations in the document: if this paragraph appears in a list, apply style LIST. No user-specified conditions are allowed.

Conditional text is text only; no formatting.
AOO4/LO5 • Linux • Fedora 23
F3K Total
Volunteer
Posts: 1044
Joined: Fri Dec 16, 2011 8:20 pm

Re: Using conditional formatting in OO writer

Post by F3K Total »

There is a little possibility, if you want to format numbers.
You can have three colors depending on the value, using Number Format... (rightclick in the cell)
E.g. this

Code: Select all

[<3][GREEN]0;[<6][YELLOW]0;[RED]0
gives this result:
CF.png
CF.png (2.3 KiB) Viewed 4736 times
See example attached
R
Attachments
CF.odt
(15.63 KiB) Downloaded 216 times
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 11 AOO, LO | Linux Mint AOO, LO
onlinealien
Posts: 3
Joined: Sat Nov 21, 2015 12:08 pm

Re: Using conditional formatting in OO writer

Post by onlinealien »

Thank you so much for your effort

F3K Total, number formatting is simple and genuis - that's all what I need

I played with conditional paragraph styling but couldn't get nowhere

Thanks
Open Office 4.1.1 win7
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Using conditional formatting in OO writer

Post by acknak »

F3K Total wrote:There is a little possibility, if you want to format numbers. ...
Good suggestion!

The other workaround would be to use an embedded spreadsheet object in place of the Writer table.
AOO4/LO5 • Linux • Fedora 23
onlinealien
Posts: 3
Joined: Sat Nov 21, 2015 12:08 pm

Re: Using conditional formatting in OO writer

Post by onlinealien »

acknak wrote:
F3K Total wrote:There is a little possibility, if you want to format numbers. ...
Good suggestion!

The other workaround would be to use an embedded spreadsheet object in place of the Writer table.
You're right, acknak. Number formatting is very limited in options and colors; embedding a spreadsheet is the ideal solution.

Thanks
Open Office 4.1.1 win7
Post Reply