hunnypu's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
1 (0 per day)
Joined:
19-March 12
Profile Views:
236
Last Active:
User is offline Mar 20 2012 08:07 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   hunnypu has not set their status

Posts I've Made

  1. In Topic: Using HTML in CFReport Builder data

    Posted 19 Mar 2012

    View PostarmyCoder, on 05 November 2009 - 01:05 PM, said:

    Ok, I think I got a fix here.

    Since the report builder automatically kills its attempt at rendering the HTML once it encounters a foreign tag, we create a function so that it will do it's best to convert what it can, and clean the rest out so the output can have a chance at displaying properly.

    First, create a report function by going to Report-->Report functions.

    Name your new function dummyHTML.

    Paste the below into the function, save it.
    
    
    <cfargument name="source" required="yes">
    <cfset char_ASCII="  ,&,<,>,« , »,oeu,Œ,…,œ,€,’,Æ,Á,Â,À,Å,Ã,Ä,Ç,Ð,É,Ê,È,Ë,Í,Î,Ì,Ï,Ñ,Ó,Ô,Ò,Ø,Õ,Ö,Þ,Ú,Û,Ù,Ü,Ý,á,â ,æ,à,å,ã,ä,ç,é,ê,è,ð,ë,í,î,ì,ï,ñ,ó,ô,ò,ø,õ,ö,ß,þ,ú,û,ù,ü,ý,ÿ,¡,£,¤,¥,¦,§,¨,©,ª,« ,¬,­,®,¯,°,±,²,³,´,µ,¶,·,¸,¹,º,»,¼,½,¾,¿,×,÷,¢,•">
    
    <!---EDIT: MAKE SURE TO put the nbsp back together, it wouldnt display right in the forum!--->
    
    <cfset char_HTML="& nbsp;,&amp;,&lt;,&gt;,&laquo; , &raquo;,&oelig;u,&OElig;,...,&oelig;,&euro;,',&AElig;,&Aacute;,&Acirc;,&Agrave; ,&Aring;,&Atilde;,&Auml;,&Ccedil;,&ETH;,&Eacute;,&Ecirc;,&Egrave;,&Euml;,&Iacute;,&Icirc;,&Igrave;,&Iuml;,&Ntilde;,&Oacute;,&Ocirc;,&Ograve;,&Oslash;,&Otilde;,& Ouml;,&THORN;,&Uacute;,&Ucirc;,&Ugrave;,&Uuml;,&Yacute;,&aacute;,&acirc;,&aelig; ,&agrave;,&aring;,&atilde;,&auml;,&ccedil;,&eacute;,&ecirc;,&egrave;,&eth;,&euml;,&iacute;,&icirc;,&igrave;,&iuml;,&ntilde;,&oacute;,&ocirc;,&ograve;,&oslash;,& otilde;,&ouml;,&szlig;,&thorn;,&uacute;,&ucirc;,&ugrave;,&uuml;,&yacute;,&yuml;, &iexcl;,&pound;,&curren;,&yen;,&brvbar;,&sect;,&uml;,&copy;,&ordf;,&laquo;,&not; ,&shy;,&reg;,&macr;,&deg;,&plusmn;,&sup2;,&sup3;,&acute;,&micro;,&para;,&middot; ,&cedil;,&sup1;,&ordm;,&raquo;,&frac14;,&frac12;,&frac34;,&iquest;,&times;,&divi de;,&cent;,&##8226;">
    
    <cfset clean = '#ReplaceList(source,char_HTML,char_ASCII)#'>
    <cfset clean = '#ReReplaceNoCase(clean,"<[^>]*>","","ALL")#'>
    <cfset clean = '#ReReplaceNoCase(clean,"&.*;","","ALL")#'>
    <cfreturn clean>
    
    



    So this takes any results that have extra...funky tags and strips them out. This worked well for me because it counts the tags I need it to see and wipes out the funky ones...including any other &.....; tags that aren't included in the function.

    Now create a new field, right click it, make sure the XHTML formatted text option is checked.

    In the expression builder type:

    report.dummyHTML(string)
    
    


    Where string is whatever you want to output. You may need 'query.string' depending on how you're getting your results.

    See this forum on Adobe to see how this function started...Antoine actually started the idea, and I added on some more pieces that finished it well for me.

    http://forums.adobe....2371167#2371167

    you can add more HTML codes to the function...get them from the link below:

    http://www.ascii.cl/htmlcodes.htm (make sure to use ## where needed)

    Hope this helps!


    This did not work.
    It works same as you put: #ReReplace(string, "(<[^>]*>)", " ", "All")# In the expression builder.

    My scenario is: From application I have key-in data that using WYSIWYG editor with various format like font color, background color, alignment, bold, italic, etc. And store to a column type CLOB (I am using Oracle DB).
    Now I have to show this data on ColdFusion Report that using a CFR template in exactly format as it is. I have ticked the XHTML check box for the field property on ColdFusion Report Builder design for this report.
    Anyone have any solution for this issue.
    I see someone have the same issue here: http://forums.adobe....3057027#3057027
    But never has any answer for it (even from Adobe support team).

    Any answer, I am highly appreciate :)

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

hunnypu hasn't added any friends yet.

Comments

hunnypu has no profile comments yet. Why not say hello?