Focal Point
Conditional Report Header

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

August 15, 2007, 09:52 AM
ColdWhiteMilk
Conditional Report Header
I have a standard report header that I use for my WebFOCUS reports (7.1.3). I am trying to update this header so that certain rows of the header are "conditional" based on the values in global variables.

Right now I have:

TABLE FILE JOB
HEADING
"Proprietary Information"
"Report Name"
"Data Source: "
"Data As Of: "
"Date Prepared: "
"Prepared By: "
PRINT

What I would like to do is use a global variable such as:

-SET &USEPI = 1;

When the value of USEPI equals 1, then the "Proprietary Information" line of the header would be used, other wise, the top line of the report header would be "Report Name".

Does anyone have a sample of code to do this, or can you make any suggestions?

Thank you.

This message has been edited. Last edited by: ColdWhiteMilk,
August 15, 2007, 10:00 AM
Leah
Have you considered the use of
ON TABLE SUBHEAD
"informantion here line"

which would only print on the first page and then have your HEADING always be what you wish to have.


Leah
August 15, 2007, 10:08 AM
ColdWhiteMilk
I don't understand. Will that allow me to do conditional lines of the report header?

Do you have a sample?


Production - 7.6.4
Sandbox - 7.6.4
August 15, 2007, 10:19 AM
Tom Flynn
quote:


TABLE FILE JOB
HEADING

-IF &USEPI NE 1 GOTO SKIP_THIS;
"Proprietary Information"
-GOTO NEXT_1
-SKIP_THIS
"Report Name"
-NEXT_1

"Data Source: "
"Data As Of: "
"Date Prepared: "
"Prepared By: "
PRINT




Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 15, 2007, 10:26 AM
ColdWhiteMilk
Woohoo!

You guys rock!

Thank you for the help.


Production - 7.6.4
Sandbox - 7.6.4
August 15, 2007, 10:29 AM
Leah
Did a quick one against IB COURSE file
  
TABLE FILE COURSE
PRINT 
     COURSECODE
     CTITLE
BY SOURCE
     
ON SOURCE PAGE-BREAK 
ON TABLE SUBHEAD
"This is the report heading"
HEADING
"This is the page heading"
FOOTING
"<TABPAGENO of  <TABLASTPAGE"
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     LEFTMARGIN=0.500000,
     RIGHTMARGIN=0.500000,
     TOPMARGIN=0.500000,
     BOTTOMMARGIN=0.500000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
     TOPGAP=0.013889,
     BOTTOMGAP=0.027778,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
     SIZE=9,
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END

Gives this, but it probably won't look to pretty here

This is the report heading

This is the page heading

SOURCE COURSECODE CTITLE
AMERICAN MANAGEMENT ASSOCIATION AMA130 HOW TO WRITE USERS MANUAL
AMA680 BUSINESS TO BUSINESS MKTG STRATEGY
AMA800 INTERVIEWING: A STRATEGIC APPROACH

1 of 14


This is the page heading

SOURCE COURSECODE CTITLE
BUSINESS INSTITUTE OF TECHNOLOGY BIT420 EXECUTIVE COMMUNICATION
BIT640 NEGOT AND ADMIN THE LABOR CONTRACT
BIT650 IMPROVING INTERNAL CONSULTING SKILL

2 of 14


Leah
August 15, 2007, 11:48 AM
Darin Lee
Another variation on Tom's Dialogue Manager idea that we use:
-SET &HEAD1=IF &USEPI NE 1 THEN '"'|'Heading Line 1'|'''' ELSE '';
TABLE FILE JOB
HEADING
&HEAD1.EVAL
"Data Source"
.
PRINT

IMO, it requires less DM and is a litte more readable inside the TABLE request. For Clarification, the tick marks are single, double, single which would produce the value "Heading Line 1"


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
August 15, 2007, 01:30 PM
ColdWhiteMilk
Darin-

I think that your approach works well also. I think that it might be a little cleaner to read as well rather than all the goto statements.

Thank you all!

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


Production - 7.6.4
Sandbox - 7.6.4