Focal Point
[Solved]StyleSheet Conditioning

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

May 06, 2010, 04:27 AM
Kevin Tong
[Solved]StyleSheet Conditioning
Hi Guys,

I am trying to based on &WFFMT on whether to use which image path to cater for PDF and HTML, but it seems it is not working. Can you guys help to see what went wrong.

-SET &PDFIMGURL = 'logo.gif';
-SET &HTMLIMGURL = '/approot/test/logo.gif';


JOIN
 INNER CUST.CUST.IPKIPN IN CUST TO MULTIPLE APPL.APPL.ANKIPN IN APPL TAG J0
 AS J0
 END

DEFINE FILE CUST
FLAG/A1 = IF &WFFMT EQ HTML THEN '1' ELSE '0';
MALE/I7 = IF IPSEX EQ 1 THEN + 1 ELSE + 0;
FEMALE/I7 = IF IPSEX EQ 2 THEN + 1 ELSE + 0;
END

TABLE FILE CUST
SUM
     'CUST.CUST.MALE' AS 'Male'
     'CUST.CUST.FEMALE' AS 'Female'
BY 'CUST.CUST.AGERANGE' AS 'Age Range'
ON TABLE SUBHEAD
"  "
" "
HEADING
"APPLICATION APPROVED FROM <+0>&dateFrom <+0>TO<+0> <+0>&dateTo"
" "
"AGE VS GENDER"
" "
FOOTING
" "
" "
" "
"Private & Confidential"
"Report Generated On <+0>&DATEtrDMYY<+0>    "
ON TABLE SET PAGE-NUM ON
ON TABLE ROW-TOTAL/I11 AS 'Total'
ON TABLE SUMMARIZE AS 'Total'
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     PAGECOLOR=RGB(245 245 245),
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     IMAGE=&HTMLIMGURL,
     POSITION=(+0.055556 -0.027778),
     SIZE=(1.680556 0.402778),
  WHEN=FLAG EQ '1',
$
TYPE=TABHEADING,
     IMAGE=&PDFIMGURL,
     POSITION=(+0.055556 -0.027778),
     SIZE=(1.680556 0.402778),
WHEN=FLAG EQ '0',
$


Thank you in advance.

Regards,
Kevin Tong

This message has been edited. Last edited by: Kevin Tong,


WebFOCUS 7.6.9
Windows 2003, all output
May 06, 2010, 06:11 AM
Dan Satchell
Both images need to be somewhere in your APP path. Give them different names to avoid confusion - for example html.gif and pdf.gif. You can eliminate the DEFINEd FLAG and WHEN clause in the stylesheet by making the logo decision with Dialogue Manager:

-SET &IMGURL = IF &WFFMT EQ 'HTML' THEN 'html.gif' ELSE 'pdf.gif';
.
.
.
.
TYPE=TABHEADING,
     IMAGE=&IMGURL,
     POSITION=(+0.055556 -0.027778),
     SIZE=(1.680556 0.402778),
$
.
.



WebFOCUS 7.7.05
May 06, 2010, 06:24 PM
Waz
I would suggest:

-SET &IMGURL = IF &WFFMT EQ 'PDF' THEN 'logo.gif' ELSE '/approot/test/logo.gif'
.
.
.
.
.
TYPE=TABHEADING,
     IMAGE=&IMGURL,
     POSITION=(+0.055556 -0.027778),
     SIZE=(1.680556 0.402778),
$



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

May 06, 2010, 09:11 PM
Kevin Tong
Dan & Waz,

Thanks for replying. Both solution works, you guys rocks.

Regards,
Kevin Tong


WebFOCUS 7.6.9
Windows 2003, all output