Focal Point
how to hide conditional hyperlink on heading if record EQ 0

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

August 09, 2007, 11:30 AM
JZMSH
how to hide conditional hyperlink on heading if record EQ 0
Hi,

I am trying to find a way to hide conditional hyperlink on heading if record is showing 0. The problem is in my master fex, I have a query like:
TABLE FILE TABLE1
PRINT .....
END
HEADING '.....'

In my heading, I want to apply the conditional formatting actually from
TABLE FILE TABLE2
WHERE ....

IF &RECORDS NE 0 THEN
display 'Click here to drill down to child report' on my heading

and if &RECORDS EQ 0 THEN display blank line on heading.

Please suggest.

Julie
August 09, 2007, 11:49 AM
ypatel
Julie, Try this
Step 1 do the table file that is the deciding factor in displaying hyper link or not..

TABLE FILE TABLE2
WHERE ....

Step 2 - set a variable

-SET &HLINK = IF &RECORDS NE 0 THEN
'Click here to drill down to child report'
ELSE ' ';

Now use this &HLINK in your heading of table file 1.
TABLE FILE TABLE1
PRINT .....
HEADING
"&HLINK.EVAL"
..
END

Hope this helps !!


-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux
August 09, 2007, 01:02 PM
JZMSH
Yogesh,

It works perfectly. Thank you so much.......



Julie
August 15, 2007, 04:42 PM
JZMSH
Hi again,

When I tried to apply a condition for &HLINK.EVAL in the style sheet, syntax as:
DEFMACRO=HLINKCOND1, MACTYPE=RULE, WHEN = '&HLINK2' NE ' ', $

TYPE=HEADING, LINE=1, MACRO=HLINKCOND1, FOCEXEC=CHILD_REPORT, $

It didn't work. Does anyone know how to fix it?
August 15, 2007, 06:33 PM
Darin Lee
I don't know if you can do conditional styling on the HEADING like you are wanting specify. The proper format is WHEN=field1 operator {field2|value}, $
Conditional styling is based on the value of a field on a record. HEADINGs are unrelated to individual records. They appear at the top of every page regardless of record values. Try defining a field to the value of &HLINK2 (you can NOPRINT it) and then use that field in your WHEN.


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, 09:49 PM
Tom Flynn
JZMSH,

Some folk's don't like branching, I do:

quote:

DEFMACRO=HLINKCOND1, MACTYPE=RULE, WHEN = '&HLINK2' NE ' ', $
TYPE=HEADING, LINE=1, MACRO=HLINKCOND1, FOCEXEC=CHILD_REPORT, $



-IF &HLINK2 EQ '' GOTO SKIP_DRILL;

DEFMACRO=HLINKCOND1, MACTYPE=RULE, $
TYPE=HEADING, LINE=1, MACRO=HLINKCOND1, FOCEXEC=CHILD_REPORT, $

-SKIP_DRILL



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 16, 2007, 08:38 AM
Fernando
JZMSH,

Tom's solution will work.

quote:

-IF &HLINK2 EQ '' GOTO SKIP_DRILL;
DEFMACRO=HLINKCOND1, MACTYPE=RULE, $
TYPE=HEADING, LINE=1, MACRO=HLINKCOND1, FOCEXEC=CHILD_REPORT, $
-SKIP_DRILL


If you do not like the skip then change the when to use a field against a value (it must be a field against a value or another field, not a value against a value)

quote:

WHEN = '&HLINK2' NE ' ', $


to:
quote:

DEFMACRO=HLINKCOND1, MACTYPE=RULE, WHEN = MYLINK NE ' ', $


and use a compute to create MYLINK.

COMPUTE MYLINK/A255='&HLINK2'; NOPRINT

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
August 16, 2007, 10:29 AM
JZMSH
Tom and Fernando,

Both solution is working for my case. Thank you so much for your help!!!!!!
Smiler


Julie