Focal Point
how to apply CSS to a drilldown anchor tag?

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

December 14, 2006, 02:49 PM
susannah
how to apply CSS to a drilldown anchor tag?
I want to apply several different styles to different anchor tags for different drilldowns, and i can't seem to style the anchor tag in css with a class attribute, i can only apply 1 anchor style to all anchors...yuck.

A CLASS applied to the TYPE=HEADING,ITEM=2,FOCEXEC=(...),CLASS=whatever,$
only applies to the TD tag, not to the anchor.
Specifying
.whatever {...}
and/or
a.whatever {...}
has no effect.
Specifying
a {...}
does work, but that means the same formatting for every type of link in a report, which is no good at all.

I've tinkered till i'm nuts, Could anyone offer a suggestion? TIA.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 15, 2006, 05:54 AM
Tony A
Hi Susannah,

This is a tricky one mainly because IB (in their infinite wisdom) do not place class values within their anchor tags upon report generation.

The only way I can see to get around this is to build your anchor tag in a variable, compute or define and then include that in your heading. Not what you want to hear but unfortunately .....

-* File css_example.fex
-SET &MRE_RANDx = RDUNIF('D12.2') * 65536;
-DEFAULT &MRE_RAND = &MRE_RANDx
DEFINE FILE CAR
  heading_a/A200 = '<A class=whatever2 HREF="/ibi_apps/WFServlet?IBIF_webapp=/ibi_apps&|IBIC_server=
      EDASERVE&|IBIWF_msgviewer=OFF&|IBIAPP_app=baseapp&|IBIF_ex=css_example&|CLICKED_ON=
      &|MRE_RAND=&MRE_RANDx"> on the forum</A>';
END
TABLE FILE CAR
 SUM RCOST AS 'Cost to End Buyer'
OVER DCOST AS 'Cost to Dealer'
OVER COMPUTE Profit/D9 = RCOST - DCOST; AS 'Profit'
BY COUNTRY
BY CAR
BY MODEL
HEADING
"Test for <+0> Susannah <+0> <heading_a"
ON TABLE SET PAGE-NUM OFF
ON TABLE SET LINES 9999
ON TABLE HOLD AS MYTABLE FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=REPORT, CLASS=TABLE, $
TYPE=HEADING, ITEM=2, CLASS=whatever1, FOCEXEC=css_example(MRE_RAND=&MRE_RANDx), $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
<title>CSS Example</title>
<style>
 .TABLE {font-family:Tahoma; font-size:8pt; border-style: NONE;}
 .whatever1 {font-family:Tahoma; font-size:8pt; font-weight:bold; color:#00ffff; background-color:#ffffff;}
 .whatever2 {font-family:Tahoma; font-size:8pt; font-weight:bold; color:#ff0000; background-color:#ffffff;}
</style>
</head>
<body>
<INPUT type=hidden value=!IBI.AMP.MRE_RAND; name="IBIMR_random" id="IBIMR_random">
!IBI.FIL.MYTABLE;
</body>
</html>
-HTMLFORM END


Have a look at the source and you'll see no class within the "A HREF="

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
December 15, 2006, 10:18 AM
Francis Mariani
Susannah,

The following will work only if you have

HEADALIGN=BODY

as this creates separate TD's for each item in the Heading line.

-* File anchor_test.fex

TABLE FILE CAR
SUM
SALES
BY COUNTRY
HEADING
"ANCHOR1 <+0> ANCHOR2 <+0> ANCHOR3"
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING, ITEM=1, CLASS=link1, STYLE=BOLD, FOCEXEC=ANCHOR_TEST, $
TYPE=HEADING, ITEM=2, CLASS=link2, STYLE=BOLD, FOCEXEC=ANCHOR_TEST, $
TYPE=HEADING, ITEM=3, CLASS=link3, STYLE=BOLD, FOCEXEC=ANCHOR_TEST, $
ENDSTYLE
ON TABLE HOLD AS HREP001 FORMAT HTMTABLE
END
-RUN

-HTMLFORM BEGIN
<HTML>
<HEAD>
<STYLE>
.link1 A { color: red;    text-decoration: none; }
.link2 A { color: green;  text-decoration: none; }
.link3 A { color: orange; text-decoration: none; }
</STYLE>
</HEAD>
<BODY>
!IBI.FIL.HREP001;
-HTMLFORM END
<BODY>
</HTML>


The
 .link1 A 
syntax styles anchors inside elements that have been tagged with .link1.

Cheers and have a good weekend.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server