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.
I have some data that must be displayed in a PDF report. The data contains HTML tags because it is also displayed in HTML pages. I need to strip the HTML tags before displaying it in the PDF report. The issue is compounded by the fact this is a compound PDF report - I had originally thought using HTMLFORMTYPE=PDF would work, but it doesn't, and even if it did, how would I combine that HTMLFORMTYPE code with the rest of the compound PDF components.
Any ideas?
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
Is it a single line of HTML or multiple, and how will the be needed ?
I have an idea.
The basics is to TABLE, and use STRREP the < and > characters to {crlf}< and >{crlf}. Save to a file. Reread with a new master, then toss all lines that have < or > or are blank.
I had the same need so I wrote an SQL procedure to handle it. Here is the code I used:
Create PROCEDURE striptags
(IN Dirty varchar (4000),
OUT Clean varchar (4000))
language sql
Begin
Declare @Clean VARCHAR(4000);
Declare @Start int;
Declare @End int;
set @Clean=Dirty;
While locate('<', @Clean) > 0 And
locate('>', @Clean)>0 DO
Set @Start = locate('<', @Clean);
set @End = locate('>', @Clean);
if @start=1 THEN
set @Clean= substr(@Clean,(@END+1),(length(@Clean)-@end));
ELSEIF @start>1 and @start<length(@Clean) THEN
set @Clean=substr(@Clean,1,(@start-1))||
substr(@Clean,(@end+1),(length(@Clean)-@end));
elseif @end=length(@Clean) then
set @Clean=substr(@Clean,1,(@start-1));
END IF;
END while;
set Clean=@Clean;
END
I tried to keep it somewhat simple by using the Oracle PL/SQL regexp_replace function:
SQL SQLORA
select
regexp_replace ( regexp_replace ( comment_text, '&|nbsp;', ' ', 1, 0, 'i' ), '<[^>]*>', ' ' ) as comment_text
from report_comments
where report_cde = 'report1'
and section = 'status'
and line_num = 1
;
TABLE ON TABLE HOLD AS HCOMMENT1
END
But, of course, it's not so simple as I have three nested function calls! And I just realized this does not take care of and other like HTML character entities...
(Updated with simplified code that takes care of HTML tags and - which is good enough for me...).This message has been edited. Last edited by: Francis Mariani,
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
DEFINE FILE CAR
TAGGEDLINE/A300 = '<FONT color=#000000><P><FONT color=#000000>Results are closed as of January 31, 2011. </FONT></P><P><FONT color=#000000>Zzzzz xxx dddd rrrr tttt. QQQQQ ffff. Tgggggggg ddddd lllll dddddddd rrrrrrr.</FONT></P><P>test21</P></FONT>';
END
TABLE FILE CAR
HEADING
"<TAGGEDLINE"
PRINT COUNTRY
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, MARKUP=ON, SIZE=9, ORIENTATION=LANDSCAPE, $
ENDSTYLE
END
I found an old post where you revealed MARKUP to the world! Unfortunately it doesn't take care of hyperlinks and there's a mailto hyperlink in the text
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