Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     WebFOCUS Style Macros

Read-Only Read-Only Topic
Go
Search
Notify
Tools
WebFOCUS Style Macros
 Login/Join
 
Expert
posted
I never use Style macros, preferring to repeat the styling I require, but I wonder if a macro will help in the following situation:

I have a heading line that is generated by code (meaning the content can change). It is displayed in a HEADALIGN=BODY heading, with multiple items in the line.

Is it possible to use a macro to automate the font colour based on the content of the item?

123 <+0> (232) <+0> 985 <+0> (384)

I would like (232) and (384) to be in red.

Thanks,


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
I think you can, but what we do is create a output file with a fex, hold that output and then include that in the second part of the fex.
The output file has code for the color, bold and other formatting issues.
I think you understand the idea.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Frank,

I agree that your suggestion is the easiest approach.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Francis,

You could use the WHEN= in the style.

 


-SET &PRINTIT = IF &DEF EQ 1 THEN 'BY  LOWEST CAR.COMP.CAR NOPRINT' ELSE 'BY  LOWEST CAR.COMP.CAR '; 
 
TABLE FILE CAR
PRINT 
     CAR.CARREC.MODEL
     CAR.BODY.SEATS

&PRINTIT
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
TYPE=DATA,
     COLUMN=N2,
     STYLE=BOLD+UNDERLINE,
     COLOR='RED',
	 WRAP=4.00,
     WHEN=&DEF NE 1,
$
TYPE=TITLE,
     COLUMN=N4,
     STYLE=BOLD,
$
ENDSTYLE
END


 


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Silver Member
posted Hide Post
You could break string up into additional parameters using GETTOK, and then evaluate each parameter.

The macro itself doesn't seem to be very useful if you prefer to write the styles for each field. It seems more a shorthand for a preset definition than dynamic instructions.

  -SET &HEADLINE='123 <+0> (232) <+0> 985 <+0> (384)';
-SET &HFMT1=IF(GETTOK(&HEADLINE,&HEADLINE.LENGTH,1,'+',20,'A20V'))CONTAINS '(' THEN 1 ELSE 0;
-SET &HFMT2=IF(GETTOK(&HEADLINE,&HEADLINE.LENGTH,2,'+',20,'A20V'))CONTAINS '(' THEN 1 ELSE 0;
-SET &HFMT3=IF(GETTOK(&HEADLINE,&HEADLINE.LENGTH,3,'+',20,'A20V'))CONTAINS '(' THEN 1 ELSE 0;
-SET &HFMT4=IF(GETTOK(&HEADLINE,&HEADLINE.LENGTH,4,'+',20,'A20V'))CONTAINS '(' THEN 1 ELSE 0;
-SET &HFMT5=IF(GETTOK(&HEADLINE,&HEADLINE.LENGTH,5,'+',20,'A20V'))CONTAINS '(' THEN 1 ELSE 0;

TABLE FILE CAR
PRINT 
     CAR.CARREC.MODEL
     CAR.BODY.SEATS

HEADING
"&HEADLINE"

ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=HEADING,ITEM=1,COLOR=ORANGE,STYLE=BOLD,WHEN=&HFMT1 EQ 1,$
TYPE=HEADING,ITEM=2,COLOR=ORANGE,STYLE=BOLD,WHEN=&HFMT2 EQ 1,$
TYPE=HEADING,ITEM=3,COLOR=ORANGE,STYLE=BOLD,WHEN=&HFMT3 EQ 1,$
TYPE=HEADING,ITEM=4,COLOR=ORANGE,STYLE=BOLD,WHEN=&HFMT4 EQ 1,$
TYPE=HEADING,ITEM=5,COLOR=ORANGE,STYLE=BOLD,WHEN=&HFMT4 EQ 1,$

ENDSTYLE
END


WF: WebFocus 7.7.03
Data: Oracle, MSSQL, DB2
OS: Windows
Output: HTML/AHTML,PDF,EXL2K FORMULA, COMT
 
Posts: 43 | Registered: November 21, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     WebFOCUS Style Macros

Copyright © 1996-2020 Information Builders