Focal Point
[CLOSED] Conditional Footing

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4247067895

February 15, 2011, 10:41 AM
Dinesh1982
[CLOSED] Conditional Footing
Hi,

Is there any way to show the footer conditionally based on the data in data page.


Ex:
Page:1

X Y Z
1 2 3
4 5 6
1 1 1

Page:2

X Y Z
1 1 1
1 1 1
1 1 1

Here I need to show footing only for the pages to which if any value on column Z is 6 so i need to show the footer on page 1 alone.

Thanks in advance.

This message has been edited. Last edited by: Kerry,


WebFOCUS 764
Unix
Excel, HTML, PDF
February 15, 2011, 11:28 AM
Wep5622
You can probably use the behaviour of FOC_NONE to hide the footer until there's an applicable value for Z in your data. Something like this:
DEFINE FILE CAR
SHOWFOOT/I1 = IF CAR EQ 'JAGUAR' THEN 1 ELSE FOC_NONE;
END
TABLE FILE CAR
PRINT *
ON TABLE FOOTING
"<MAX.SHOWFOOT Line 1"
"<MAX.SHOWFOOT Line 2"
"etc."
END


Haven't tried this though.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
February 15, 2011, 02:46 PM
DavSmith
Hi Wep, your example won't work. FOC_NONE is designed to hide any non-Dialogue Manager line it appears on when it appears as the value in an amper variable.

It will NOT hide the report code line it appears on as a substituted value in a computed/defined field.

1) -SET &HIDE='FOC_NONE';
2) TABLE FILE CAR 
3) PRINT CAR
4) BY '&HIDE' BY MODEL
5) END


The server report engine parser will ignore ALL of line 4.

Dinesh, you cannot program conditional page footings but you can program conditional subfoots, but even that may not get you what you need if you need it to always appear at the bottom of the page.

If you think a conditional subfoot might be the ticket, the following code is a quick example:

TABLE FILE CAR
PRINT MODEL
BY DEALER_COST
BY CAR 
BY MODEL NOPRINT SUBFOOT
"***SUBFOOT***"
WHEN MODEL EQ 'TR7'
END




In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
February 15, 2011, 03:29 PM
Mary Watermann
The FOC_NONE in the above example doesn't work.

Try this:

TABLE FILE CAR
SUM
DEALER_COST
BY COUNTRY
BY CAR PAGE-BREAK
ON CAR SUBFOOT
"Line 1"
"Line 2"
"etc."
WHEN CAR EQ 'JAGUAR'
END

You can not do a WHEN condition on the HEADING/FOOTING in 764 (I believe you can in 7.7.02)


WF 7.6.10, Windows, PDF, Excel
February 15, 2011, 04:15 PM
GinnyJakes
Have you looked into using the WHEN command. It allows you to test data to determine whether to display a subfoot, etc.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 16, 2011, 03:43 AM
Wep5622
What you can do is use CSS to hide the footing (provided your output format is HTML of course). You'll need to provide a CSS file
ON TABLE SET CSSURL your-css-file
, in which you can define a CSS class :
.hidden { display: none; }


With that you can conditionally refer to that in your webFOCUS stylesheet using:
TYPE=FOOTING, CLASS=hidden, WHEN=CAR EQ 'JAGUAR',$



WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
February 16, 2011, 01:07 PM
DavSmith
Mary/Ginny, we were thinking along the same lines at about the same time!

Wep, you are thinking out of the box, but using a condition on the FOOTING stylesheet element works on the same principle as displaying data in a footing, it will only work with the last value on the page. You did give me an idea, though.

Here's a CAR database example that should work (HTML and PDF) for Dinesh showing the FOOTING only when the page contains the target data:

-SET &CAR='DATSUN';
-SET &LNSPP=15;
TABLE FILE CAR
HEADING
"Page: <TABPAGENO </1"
SUM CAR
TABPAGENO NOPRINT
COMPUTE CARMARK/I1=IF CAR EQ '&CAR' THEN 1 ELSE 0;NOPRINT
COMPUTE FOOTMARK/P8=IF TABPAGENO     NE LAST TABPAGENO THEN CARMARK ELSE
		  IF CARMARK       EQ 1              THEN 1       ELSE
		  IF LAST FOOTMARK EQ 1              THEN 1       ELSE 0;NOPRINT
COMPUTE FOOT/A75=IF FOOTMARK EQ 1 THEN 'This FOOTING will appear on the page where the CAR is &CAR.EVAL .' ELSE '';NOPRINT 
BY COUNTRY
BY MODEL 
FOOTING
"<FOOT</1"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE NOLEAD
ON TABLE SET LINES &LNSPP.EVAL
ON TABLE SET STYLE *
GRID=OFF,$
TYPE=FOOTING,COLOR=RED,$
ENDSTYLE
END


This will force the FOOTING to appear only on the page where DATSUN appears.

This message has been edited. Last edited by: DavSmith,



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle