Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] HTML tags in HTML output
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] HTML tags in HTML output
 Login/Join
 
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.1.05M
Windows 2003
Excel, HTML, PDF
 
Posts: 27 | Registered: April 22, 2009Reply With QuoteReport 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, 2007Reply With QuoteReport This Post
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.1.05M
Windows 2003
Excel, HTML, PDF
 
Posts: 27 | Registered: April 22, 2009Reply With QuoteReport 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, 2007Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2005Reply With QuoteReport This Post
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.1.05M
Windows 2003
Excel, HTML, PDF
 
Posts: 27 | Registered: April 22, 2009Reply With QuoteReport 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, 2007Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6053 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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, 2007Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6053 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] HTML tags in HTML output

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.