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.
There's a strip function, but I believe that only removes a specific character from a string. You might try the STRREP function, replacing any HTML tags that might exists with spaces and then use SQUEEZ to remove extraneous spaces.
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
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Darin, Thank you for your quick response. If I use STRREP function, I have to hard code all the HTML tags which is very difficult. Is there a way to use HTML formatting in the field values instead?
If what you're producing is an HTML report, those tags will be sent as they are by WF and will be resolved and rendered by your browser. There is a potential risk of not having "well formed" HTML tags in your data which may impact your final output so you'll have to watch out for that.
DEFINE FILE CAR
NEW_MODEL/A40 = STRREP(24, MODEL, 4, 'DOOR', 11, '<b>DOOR</b>', 40, NEW_MODEL);
COMMENTS/A80 = IF CAR EQ 'JAGUAR' THEN '<ul><li>Nice Car</li><li>Good-looking</li></ul>' ELSE
IF CAR EQ 'PEUGEOT' THEN '<ul><li>Good-looking</li></ul>' ELSE ' ';
END
TABLE FILE CAR
PRINT CAR
COUNTRY
NEW_MODEL
COMMENTS
END
The silly code above produces some output with embedded HTML tags and they are rendered normally in my IE browser.
If I use STRREP function, I have to hard code all the HTML tags which is very difficult
What is your database? It might also be possible to create a view which filters those tags out at the database side before the records are sent to WebFOCUS.
MYTABLE has three fields(ID, NAME & COMMENTS), and COMMENT field has HTML tags. I am trying to display COMMENT in a readable format to the user and links as active links.
I think if you want the most control of the formatting you are going to have to strip out all the html code, however if you want to leave the html code as is in the field just output the report as html or htmtable. Like njsden stated the html tags will be passed along with your data to the browser.
DEFINE FILE CAR
ID/A7 WITH COUNTRY = '1234567';
NAME/A7 WITH COUNTRY = 'ABCDEF';
COMMENT/A150 WITH COUNTRY = '[b]AAAAAAAAAAA[/b]<br><br> <ul> [b]BBBBBBBBBBB:[/b]<br> <ul> NA<br> </ul> [b]CCCCCCCCCCCC:[/b]<br> <ul> NA </ul> </ul> <br> <br> DDDDDDDDDDD.';
COMMENT1/A200 = STRREP(150,COMMENT,1,'<',4,'<!--',200,'A200');
COMMENT2/A250 = STRREP(200,COMMENT1,1,'>',3,'-->',250,'A250');
END
-*
TABLE FILE CAR
PRINT COUNTRY ID NAME COMMENT COMMENT2
WHERE RECORDLIMIT EQ 1 ;
END
Edit: There are a couple of caveats. First, this technique won't work if your comment field has '<' or '>' characters that are not part of HTML tags. Second, this technique won't work if any of the HTML tags span text (<div ... </div, for example). Finally, you must make sure to increase the size of the output field to account for the number of extra characters that will be added to the input field by replacing single characters ('<' and '>') with multiple characters ('<!--' and '-->').This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007