Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » HMTL to Plain Text Computed column(Computed column)
HMTL to Plain Text Computed column [message #735965] Thu, 13 October 2011 08:48 Go to next message
gin1975  is currently offline gin1975 Friend
Messages: 30
Registered: April 2011
Member
I'm trying to configure a computed column to convert the value of a field in html plain text. So far I have not succeeded. Do you have any that may help?

thanks
Re: HMTL to Plain Text Computed column [message #736089 is a reply to message #735965] Thu, 13 October 2011 14:53 Go to previous messageGo to next message
Jean-Baptiste Guillois is currently offline Jean-Baptiste GuilloisFriend
Messages: 33
Registered: August 2011
Member
You should use a computed dataset column (using JavaScript) and use a regular expression that will strip html tags, such as:

regExp = new RegExp ("<[^>]+>","gi");
str.replace(regExp,"");

Regards,
Re: HMTL to Plain Text Computed column [message #736115 is a reply to message #736089] Thu, 13 October 2011 15:50 Go to previous messageGo to next message
gin1975  is currently offline gin1975 Friend
Messages: 30
Registered: April 2011
Member
Ok Jean, the script works. What I can not take are the following characters: "'" (&acute, etc.). Can you help me out with this issue?
thank you very much.
Re: HMTL to Plain Text Computed column [message #741421 is a reply to message #736115] Wed, 19 October 2011 14:08 Go to previous message
gin1975  is currently offline gin1975 Friend
Messages: 30
Registered: April 2011
Member
Hello,

I'm doing some tests with this computed column but I can not work. Can you check where the error may be?
thanks


regExp = new RegExp ("<[^>]+>","gi");
row["summary"].replace(regExp,"").replace("&quot;","").replace("&aacute;","á").replace("&eacute;","é").replace("&iacute;","í").replace("&uacute;","ú").replace("&oacute;","ó").replace("&nbsp;"," ");
Previous Topic:Unable to view grid in Master Page
Next Topic:Table (id=585) - Can not load the report query
Goto Forum:
  


Current Time: Thu Nov 27 18:42:46 GMT 2014

Powered by FUDForum. Page generated in 0.02202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software