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] How to escape HTML characters in report data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to escape HTML characters in report data
 Login/Join
 
Platinum Member
posted
We have a number of reports that pull user comment fields from the database, and being that they're comments, they can have any text the user chose to put in. A recent example is a user put in a comment for some email addresses they copied from a mail program, so the data looked something like this:
 <fred.worker@company.com> Fred Worker; <sally.admin@company.com> Sally Admin 


The problem is that when running the report with comments like this, in HTML format the email just doesn't show, and in Excel, you get an error about unreadable content, then it tries to repair it, and the result is a mess of an unusable report.

In both cases, it's because the HTML or the XML (in the case of Excel output) reads it as an element, not as text, which also leads me to believe that someone could put script elements in their comments that would be executed when the report is run, which I'm not exactly afraid of since this is an internal system, but still, I can't believe there wouldn't be a way of HTML escaping a field at will.

I searched the forums, but only found stuff recommending using CTRAN or STRREP to replace individual characters, but that's an unworkable solution because we don't necessarily know what the characters will be, and again, we have a number of reports and a number of these types of comments fields.

This message has been edited. Last edited by: J.Hines,



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
 
Posts: 141 | Location: North Carolina | Registered: August 10, 2012Report This Post
Virtuoso
posted Hide Post
Use the XMLENCOD function.

http://documentation.informati...7704/77snf/77snf.pdf


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Expert
posted Hide Post
Interesting that these two functions, XMLENCOD and XMLDECOD are not specified in the WebFOCUS 8 documentation - "Nothing found." in the WebFOCUS Release 8.0 Version 08 documents.


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
Virtuoso
posted Hide Post
quote:
Originally posted by Francis Mariani:
Interesting that these two functions, XMLENCOD and XMLDECOD are not specified in the WebFOCUS 8 documentation - "Nothing found." in the WebFOCUS Release 8.0 Version 08 documents.


Embrace the GUI! It's all in there (well, in the meta-data tool in the DMC at least). The doc will catch up eventually.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Expert
posted Hide Post
Another Gem found.

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
Expert
posted Hide Post
Make a note that the parameters for XMLENCOD are incomplete. They should be -

XMLENCOD(inputlen, input, opcode, outputlen, output)
Where opcode is default of 0 (zero) - I do not know what options are available though.

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
Platinum Member
posted Hide Post
quote:
Originally posted by dhagen:
Use the XMLENCOD function.

http://documentation.informati...7704/77snf/77snf.pdf


Thanks dhagen, that's helpful, but is this then on a field-by-field basis that I'd have to add a define to every report? I was hoping there'd be a setting for either the entire report or, even better, something that could be done in the master file once.



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
 
Posts: 141 | Location: North Carolina | Registered: August 10, 2012Report 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] How to escape HTML characters in report data

Copyright © 1996-2020 Information Builders