Conditional formatting footers

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
pinco pallo
Posts: 89
Joined: Tue Jul 16, 2013 2:24 pm

Conditional formatting footers

Post by pinco pallo »

Hi,
in the report atached, I would set the color of the footer according to the page number. It's possible?
P.A. the field Tot. contained in the footer of the page is incorrect, I know, but I need just as an example of footer.
Thanks.
Attachments
Country.odb
(51.06 KiB) Downloaded 379 times
Last edited by pinco pallo on Sun Jan 22, 2017 4:32 pm, edited 1 time in total.
LiBO 6.2.8.2 on macOS 10.12.6 (Sierra)
pinco pallo
Posts: 89
Joined: Tue Jul 16, 2013 2:24 pm

Re: Conditional formatting footers

Post by pinco pallo »

This conditional formatting does non work:
Attachments
Schermata 01-2457771 alle 14.07.49.png
LiBO 6.2.8.2 on macOS 10.12.6 (Sierra)
chrisb
Posts: 298
Joined: Mon Jun 07, 2010 4:16 pm

Re: Conditional formatting footers

Post by chrisb »

hello pinco pallo,

i don't think it's possible to use conditional formatting in the page footer.
if it's important then i have a workaround for you.
i made the query 'qReport_chrisb_SQL'.
it calculates a row number based on the value of "AREA_SQ_KM".
it then uses the value of row number to calculate a page number @ 48 rows per page.
we then sort by "Page" & "AREA_SQ_KM".

the view 'vReport_chrisb' was created from this query & is the data source for the report 'rbReport_chrisb'.
the report groups & sorts the data by the value of "Page".
the group header contains the labels while the group footer shows the page number("Page" + 1) & the running total of "AREA_SQ_KM".
i have conditionally formatted "AREA_SQ_KM" in the group footer to show a different color for each page(6 in total).
Attachments
Country Report.odb
(91.99 KiB) Downloaded 365 times
open office 4.1.14 & LibreOffice 6.4.4.2 x64 using HSQL 1.8.0.10 (Embedded) and HSQL 2.6.0 (Split) on Windows 10
pinco pallo
Posts: 89
Joined: Tue Jul 16, 2013 2:24 pm

Re: Conditional formatting footers

Post by pinco pallo »

Hello chrisb, thanks for the answer.
I don't think I have explained my problem well.
In the database report I need to print a footer (in the position of the footer!), only for the last page.
This is why I thought to conditional formatting, choosing the color white for the character if the page is not the last, to make it invisible.
With your system you can do but the position of the last footer of the page group is not in the right position, that of the footer.

Edit: see the picture, please.
Attachments
Schermata 01-2457776 alle 15.37.45.jpg
LiBO 6.2.8.2 on macOS 10.12.6 (Sierra)
chrisb
Posts: 298
Joined: Mon Jun 07, 2010 4:16 pm

Re: Conditional formatting footers

Post by chrisb »

OK your objectives are now clear.
it seems impossible to do anything in the page footer.
conditional formatting does not appear to work.
we cannot compare a field value with 'PageNumber()'.
if you try to show a field value for example '[AREA_SQ_KM]' then the value shown is always the value contained in the very first row of the record set.

you can achieve all of your objectives bar one (we can not position the page number & total at the foot of the page) by using the method i suggested.
the page number & total will always be shown in the footer directly below your very last row of data.
i don't think this is a bad thing, it eliminates the white space between the last row & page footer.

using my report all we need to do is replace the group footer with a report footer.
1. menu:Edit>Insert Report Header/Footer.
2. cut the label fields & text boxes from the group footer & paste them into the report footer.
3. hit 'Shrink from bottom'.
4. hit(Ctrl+G) & set 'Group Footer' = 'Not Present'.
5. click in the Report Header & in properties pane set 'Height' = 0.
open office 4.1.14 & LibreOffice 6.4.4.2 x64 using HSQL 1.8.0.10 (Embedded) and HSQL 2.6.0 (Split) on Windows 10
chrisb
Posts: 298
Joined: Mon Jun 07, 2010 4:16 pm

Re: Conditional formatting footers

Post by chrisb »

pinco pallo,

after giving this some thought i think i have a solution.
my idea is to use a predetermined number of records per page (49).
we have 251 records. 251 / 49 = 5 pages. 251 - (5 * 49) = 6, so 49 - 6 = 43 records short of a full page.
if we ensure that every page is a full page by adding (in this case 43) rows of dummy data then we can show the result of our accumulation function & page number in the report footer at the bottom of the page.

i created a table named 'Seq' with one field "ID" integer. "ID" holds a sequential value 0 to 49. this enables us to calculate & add the correct number of dummy rows as required.
there is only one query from which i created a view to be used as the data source of the report.

about the report:
the report shows three fields "COUNTRY", "CONTINENT" & "AREA_SQ_KM".
the dummy data for these fields is "", "", 0.

zero is used for "AREA_SQ_KM" because it's an integer & we want to accumulate its value.
i formatted this field as text to prevent the error 'NaN' (not a number) from being shown & used '[COUNTRY] > ""' as the conditional print expression in the properties pane to hide the dummy zeros.

incidentally neither microsoft nor oracle report engines provide options for users to conditionally format cells in the page footer.
Attachments
World_Area_Report_OK.odb
(41 KiB) Downloaded 377 times
open office 4.1.14 & LibreOffice 6.4.4.2 x64 using HSQL 1.8.0.10 (Embedded) and HSQL 2.6.0 (Split) on Windows 10
Post Reply