Bug 144826 - Conditional formatting works in Base table, not in forms
Summary: Conditional formatting works in Base table, not in forms
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-30 11:02 UTC by robinwalter31
Modified: 2021-10-17 22:04 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshots showing failure of conditional formatting in Base form (279.49 KB, image/jpeg)
2021-09-30 11:02 UTC, robinwalter31
Details
comtrol properties dialog box (183.32 KB, image/jpeg)
2021-10-01 00:55 UTC, robinwalter31
Details
The Db I'm trying to put conditionally formatted form fields in (152.62 KB, application/vnd.sun.xml.base)
2021-10-01 01:24 UTC, robinwalter31
Details
Same database - now with conditional formatted content in a form field (152.34 KB, application/vnd.oasis.opendocument.database)
2021-10-17 06:38 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robinwalter31 2021-09-30 11:02:48 UTC
Created attachment 175392 [details]
screenshots showing failure of conditional formatting in Base form

Following the instructions at 
https://help.libreoffice.org/7.2/en-US/text/shared/01/05020301.html?&DbPAR=CALC

it is possible to apply the following conditional formatting to a field in a Base table
[RED][<5]#.00;[GREEN][>7.5]#.00;[CYAN]#.00
This works exactly as it should, as shown in the screenshot. However, as the screenshot also shows, applying the conditional format to a form control property has no effect at all on the displayed data.
Comment 1 robinwalter31 2021-09-30 11:05:46 UTC
Version: 7.2.1.2 (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: en-NZ (en_NZ); UI: en-GB
Calc: CL
Comment 2 Alex Thurgood 2021-09-30 13:06:25 UTC
My understanding is that this is not possible in Base, other than through macro coding of the condition and corresponding format.

See for example:

https://ask.libreoffice.org/t/base-query-conditional-formatting/26559


The help page you have linked to relates to Calc, not Base.
Comment 3 Alex Thurgood 2021-09-30 13:10:41 UTC
(In reply to Alex Thurgood from comment #2)
> My understanding is that this is not possible in Base, other than through
> macro coding of the condition and corresponding format.

Oh, and this question too from the Ask website :

https://ask.libreoffice.org/t/conditional-formatting-in-table-controls/227

which basically confirms that conditional formatting isn't available in forms, at least not for grid controls.
Comment 4 Alex Thurgood 2021-09-30 13:28:53 UTC
@Robin : it is interesting though, that the datasource grid (as illustrated in your screenshot) is NumberFormatter aware, but not the Form controls.

ConditionalFormatting is also possible in the ReportBuilder.
Comment 5 Alex Thurgood 2021-09-30 13:36:21 UTC
@Robin :

Please see also this discussion :

https://forum.openoffice.org/en/forum/viewtopic.php?f=39&t=84111
Comment 6 m_a_riosv 2021-09-30 13:46:40 UTC
(In reply to robinwalter31 from comment #0)
> ...
> Following the instructions at 
> https://help.libreoffice.org/7.2/en-US/text/shared/01/05020301.
> html?&DbPAR=CALC
> ....

The link it's about calc not base.
Comment 7 Alex Thurgood 2021-09-30 13:54:03 UTC
@Robin :

Perhaps you should be using a "Formatted Field Control" instead ?

See, for example the Base Guide, page 145 :

https://nextcloud.documentfoundation.org/s/Rt67sEsWtg4TQJR
Comment 8 Alex Thurgood 2021-09-30 13:56:57 UTC
@Robin : please provide a sample ODB file with which we can try and confirm/infirm your findings, along with instructions on how to reproduce.

If you can get this to work with a Formatted Field Control, then please report back.
Comment 9 robinwalter31 2021-10-01 00:55:51 UTC
Created attachment 175434 [details]
comtrol properties dialog box
Comment 10 robinwalter31 2021-10-01 00:56:53 UTC
First of all, can I just say that I am stunned by the response to this bug. Thank you all. It's barely even a bug really since it's only a minor cosmetic detail


Regarding the suggestion to use a formatted field control, I believe that the control in question is a formatted field, at least if I understand the attached screenshot correctly.
Comment 11 robinwalter31 2021-10-01 01:24:07 UTC
Created attachment 175435 [details]
The Db I'm trying to put conditionally formatted form fields in
Comment 12 robinwalter31 2021-10-01 01:45:05 UTC
The attached DB is a 10 day old WIP from a rank newbie trying to learn about DBs and SQL from scratch - likely to cause horror and laughter for seasoned DB pros. Sorry!
Comment 13 QA Administrators 2021-10-01 03:52:14 UTC Comment hidden (obsolete)
Comment 14 Robert Großkopf 2021-10-14 13:31:03 UTC
Formatting of the font overwrites the conditional formatting:

Go to Control properties of the formatted field.
General → Font → Button …
Character → Font Effects → Font color
Change the value from "black" to "automatic"

The wizards for forms will set font color to black instead of "automatic". If you create a form directly without a wizard it will be "automatic".
Comment 15 Robert Großkopf 2021-10-17 06:38:58 UTC
Created attachment 175789 [details]
Same database - now with conditional formatted content in a form field

Uploaded the database. The field will now show the font in a conditional formatted way, because the font isn't directly set to a font color. Have switched the color to automatic.

I will set this bug to worksforme. Feel free to reopen, if it doesn't solve your problem.
Comment 16 robinwalter31 2021-10-17 22:04:53 UTC
 Robert Großkopf  - that DOES work, thank you! Nice to know that it was as simple as setting the font colour to automatic.