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     [SOLVED] Hi-Lite keyword in a text string

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Hi-Lite keyword in a text string
 Login/Join
 
Platinum Member
posted
Hi All,

Using the following CAR file example:

-***********************************************
-*
-SET &KEYWORD = 'AUTO';
-*
TABLE FILE CAR
PRINT MODEL
BY COUNTRY
BY CAR
WHERE MODEL CONTAINS '&KEYWORD'
END
-************************************************

Is there a way to BOLD all the occurrences of the "KEYWORD" in a text string? So in this example, when I print MODEL, all of the occurences of "AUTO" would be bolded.

Thanks
Jim

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


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Expert
posted Hide Post
Jim use GETOK to identify where the substring resides and then use judicial STYLE to highlight it.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Here's one way, HTML output:

-*-- search2.fex: highlight the matched string
-SET &ECHO=ALL;

-SET &KEYWORD = 'DOOR';
-*-SET &KEYWORD = 'AUTO';

-SET &STRREP = '<span class=hi>' || &KEYWORD || '</span>';

TABLE FILE CAR
PRINT
COMPUTE MODELX/A100 =
-*STRREP (inlength, instring, searchlength, searchstring, replength, repstring, outlength, outstring);
  STRREP (24, MODEL, &KEYWORD.LENGTH, '&KEYWORD', &STRREP.LENGTH, '&STRREP', 100, 'A100');

BY COUNTRY
BY CAR
BY MODEL
WHERE MODEL CONTAINS '&KEYWORD'

ON TABLE HOLD AS H001 FORMAT HTMTABLE
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
<style type="text/css">
.hi { color: red; }
</style>
</head>

<body>
!IBI.FIL.H001;
</body>
</html>
-HTMLFORM END

This will work for only the first string found in each row of the column.


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
Expert
posted Hide Post
You are too fast Francis. Must have that code at the top of your favorites! Smiler

From last year:

Does anyone have a technique for coloring a portion of a string


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Hi Francis/Tom,

I used the examples you provided and came up with a solution that works great.

Thanks for your responses.

This post should be marked "SOLVED".

Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report 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     [SOLVED] Hi-Lite keyword in a text string

Copyright © 1996-2020 Information Builders