Conditional formatting in Base form?
Conditional formatting in Base form?
Is it possible with conditional formatting when using a form in OpenOffice Base? I am making a task manager and when the deadline is coming up I'd like to highlite the post with a shiny red colour. I guess we need to make a macro? Or is there another way?
OpenOffice 4.1 on Windows 10
Re: Conditional formatting in Base form?
No, it is not possible. A macro can do the trick for a single-record form but not for a form grid because you can not format the rows individually.
It is possible to apply conditional formatting to a spreadsheet report.
[Tutorial] Using registered datasources in Calc
It is possible to apply conditional formatting to a spreadsheet report.
[Tutorial] Using registered datasources in Calc
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Conditional formatting in Base form?
Thanks. It is ok that it doesn't show in the report. I can sort the data there by priority anyway. So if it is possible in a single form it is good enough for me.
I am trying to make (find and copy) a macro now, but it is difficult, as I am not skilled enough to make one myself.
I am trying to make (find and copy) a macro now, but it is difficult, as I am not skilled enough to make one myself.
OpenOffice 4.1 on Windows 10
Re: Conditional formatting in Base form?
Forget macro programming. Use filters to show the records you are interested in. Or combine 2 form grids side by side with different record sets. Or use sorting. If it has to be highlighted instead of selected, then use a linked database range on a spreadsheet with conditional formatting.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Conditional formatting in Base form?
Code: Select all
Sub toggleColor(oEv)
REM get model of calling button:
oModel = oEv.Source.getModel()
nColor = oModel.BackgroundColor
if Red(nColor) = 0 then
nNew = RGB(255,0,0)
else
nNew = RGB(0,255,0)
endif
oModel.BackgroundColor = nNew
End Sub
But if it is impossible to add the same data to the database with the button as with the checkbox, I guess I instead have to use the methods you have already explained to me.
If there is nothing else to add to this topic, I thank you for your help.
OpenOffice 4.1 on Windows 10
Re: Conditional formatting in Base form?
Hello,
find attached an example. The only way i found, to format a formatted field column in a tablecontrol conditionaly.
R
find attached an example. The only way i found, to format a formatted field column in a tablecontrol conditionaly.
R
- Attachments
-
- Conditional_formatting.odb
- (12.65 KiB) Downloaded 470 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
Re: Conditional formatting in Base form?
Thanks, that works in tables showing data in form view. Very good, I needed that function.
How I did this, after looking at your example:
In edit mode I right clicked the upper part of the table at a vacant spot and added a new column. Right clicking the new column, add new, formatted, then right click the new column and choose "Column...". Under the Data tab choose the desired field from your database. Under general edit the name and label as you wish, then click [...] next to Formatting and enter the conditional formatting you like:
For the check box column I changed this into:
Note that I had to change language from Norwegian to English (USA) to make it understand the word "General" in the code. But I realized that replacing "General" with "Standard" (in my language) made it work without changing the language.
So it works, and I guess the code can have a large number of variables. In my edited code 1 gives red and General text (standard text?), 0 gives green text, and other numbers gives normal, standard text formatting.
I was not able to apply the same trick to the button color automatically by reading the data in the database, but I already have code to make it change color.
The next question is if it is possible with conditional formatting also in the generated report...? I'll let you know it I find a solution, but can manage without the report, really. Still, it was annoying with the extremely small check boxes in the report...
Thanks so far.
How I did this, after looking at your example:
In edit mode I right clicked the upper part of the table at a vacant spot and added a new column. Right clicking the new column, add new, formatted, then right click the new column and choose "Column...". Under the Data tab choose the desired field from your database. Under general edit the name and label as you wish, then click [...] next to Formatting and enter the conditional formatting you like:
Code: Select all
[<=3][RED]General;[<10][BLUE]General;General
Code: Select all
[=1][RED]General;[=0][GREEN]General;General
So it works, and I guess the code can have a large number of variables. In my edited code 1 gives red and General text (standard text?), 0 gives green text, and other numbers gives normal, standard text formatting.
I was not able to apply the same trick to the button color automatically by reading the data in the database, but I already have code to make it change color.
The next question is if it is possible with conditional formatting also in the generated report...? I'll let you know it I find a solution, but can manage without the report, really. Still, it was annoying with the extremely small check boxes in the report...
Thanks so far.
OpenOffice 4.1 on Windows 10
Re: Conditional formatting in Base form?
Hi,
with the shipped report-Builder it's not possible, but with the Oracle-Report-Builder Extension, conditional formatting can be done.
R
with the shipped report-Builder it's not possible, but with the Oracle-Report-Builder Extension, conditional formatting can be done.
R
- MMove 1.0.6
- Extension for easy, exact positioning of shapes, pictures, controls, frames ...
- my current system
- Windows 10 AOO, LOLinux Mint AOO, LO
Re: Conditional formatting in Base form?
Thanks. I installed it, and can see that this gives me more options. I couldn't find where I can add conditional formatting, but I will look more into it later. If you give me a hint, I will appreciate it very much.
OpenOffice 4.1 on Windows 10
Re: Conditional formatting in Base form?
Hi,
in Edit Mode, select a control and then Menue Format/Conditional Formatting...
R
in Edit Mode, select a control and then Menue Format/Conditional Formatting...
R
- MMove 1.0.6
- Extension for easy, exact positioning of shapes, pictures, controls, frames ...
- my current system
- Windows 10 AOO, LOLinux Mint AOO, LO
Re: Conditional formatting in Base form?
No menus are visible, for some reason. No toolbars, nothing. I can only see this:
OpenOffice 4.1 on Windows 10
- charlie.it
- Volunteer
- Posts: 417
- Joined: Wed Aug 21, 2013 2:12 pm
- Location: Italy
Re: Conditional formatting in Base form?
For this reason I use Libre Office with reports.ebrenna wrote:No menus are visible, for some reason. No toolbars, nothing. I can only see this
charlie
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1
http://www.charlieopenoffice.altervista.org
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1
http://www.charlieopenoffice.altervista.org