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     [CLOSED] HTML tags in HTML output

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] HTML tags in HTML output
 Login/Join
 
Silver Member
posted
I have to create a report off of a table that has a field with HTML tags. How do I display data without HTML tags? See sample data below:

  
ID 	: 1234567
NAME 	: ABCDEF
COMMENT : [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.



Thank you,

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


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
 
Posts: 47 | Registered: April 22, 2009Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Silver Member
posted Hide Post
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?

Thanks again,


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
 
Posts: 47 | Registered: April 22, 2009Report This Post
Gold member
posted Hide Post
Can you give us an example of your report/code? I don't quite understand what you are trying to do.


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
 
Posts: 86 | Location: Atlanta | Registered: May 10, 2007Report This Post
Virtuoso
posted Hide Post
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.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
quote:
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.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Silver Member
posted Hide Post
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.

Thanks,


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
 
Posts: 47 | Registered: April 22, 2009Report This Post
Gold member
posted Hide Post
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.


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
 
Posts: 86 | Location: Atlanta | Registered: May 10, 2007Report This Post
Expert
posted Hide Post
How many items could there be in the comment ?

Could you use a series of GETTOK's


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
You could turn the HTML tags into comments:

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, 2007Report This Post
Expert
posted Hide Post
Awesome solution if its an HTML report.
Good One


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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     [CLOSED] HTML tags in HTML output

Copyright © 1996-2020 Information Builders