Conditional formatting footers

Getting your data onto paper - or the web - Discussing the reports features of Base

Conditional formatting footers

Postby pinco pallo » Tue Jan 17, 2017 10:20 am

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 49 times
Last edited by pinco pallo on Sun Jan 22, 2017 4:32 pm, edited 1 time in total.
AOO 4.1.3 on Mac OSX
pinco pallo
 
Posts: 80
Joined: Tue Jul 16, 2013 2:24 pm

Re: Conditional formatting footers

Postby pinco pallo » Tue Jan 17, 2017 3:10 pm

This conditional formatting does non work:
Attachments
Schermata 01-2457771 alle 14.07.49.png
AOO 4.1.3 on Mac OSX
pinco pallo
 
Posts: 80
Joined: Tue Jul 16, 2013 2:24 pm

Re: Conditional formatting footers

Postby chrisb » Fri Jan 20, 2017 12:12 am

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 35 times
open office 4.1.4 & LibreOffice 5.4.2.2 (x64) using HSQL 1.8.10 (Embedded) and HSQL 2.4.0 (Split) on Windows 10
chrisb
 
Posts: 148
Joined: Mon Jun 07, 2010 4:16 pm

Re: Conditional formatting footers

Postby pinco pallo » Sun Jan 22, 2017 4:35 pm

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
AOO 4.1.3 on Mac OSX
pinco pallo
 
Posts: 80
Joined: Tue Jul 16, 2013 2:24 pm

Re: Conditional formatting footers

Postby chrisb » Sun Jan 22, 2017 8:55 pm

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.4 & LibreOffice 5.4.2.2 (x64) using HSQL 1.8.10 (Embedded) and HSQL 2.4.0 (Split) on Windows 10
chrisb
 
Posts: 148
Joined: Mon Jun 07, 2010 4:16 pm

Re: Conditional formatting footers

Postby chrisb » Sun Jan 29, 2017 3:22 pm

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 38 times
open office 4.1.4 & LibreOffice 5.4.2.2 (x64) using HSQL 1.8.10 (Embedded) and HSQL 2.4.0 (Split) on Windows 10
chrisb
 
Posts: 148
Joined: Mon Jun 07, 2010 4:16 pm


Return to Reporting

Who is online

Users browsing this forum: No registered users and 2 guests