Page 1 of 1

Conditional formatting footers

Posted: Tue Jan 17, 2017 10:20 am
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.

Re: Conditional formatting footers

Posted: Tue Jan 17, 2017 3:10 pm
by pinco pallo
This conditional formatting does non work:

Re: Conditional formatting footers

Posted: Fri Jan 20, 2017 12:12 am
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).

Re: Conditional formatting footers

Posted: Sun Jan 22, 2017 4:35 pm
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.

Re: Conditional formatting footers

Posted: Sun Jan 22, 2017 8:55 pm
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.

Re: Conditional formatting footers

Posted: Sun Jan 29, 2017 3:22 pm
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.