Good Morning everyone,
I am using a PDF format of CFReport Builder to build invoicing reports for an application we use with our clients to track support tickets. The description of both the support issue and work done on the application are in Rich Text format so they have HTML tags around them. CFReport Builder apparently doesn't like HTML tags, because it shows the HTML tags. Is there a way to have report builder actually format the data by the tags?
Using HTML in CFReport Builder dataHTML data passed into CFReport Builder needs HTML tags stripped
Page 1 of 1
7 Replies - 10001 Views - Last Post: 19 March 2012 - 12:09 AM
Replies To: Using HTML in CFReport Builder data
#2
Re: Using HTML in CFReport Builder data
Posted 14 October 2009 - 01:24 PM
Beats me but there are scripts out there you can set up as functions to strip all the HTML elements out of a string. Try looking at cflib.org for such. Strip the strings before you send them to the report builder and you should be on your way.
xheartonfire43x, on 6 Oct, 2009 - 06:58 AM, said:
Good Morning everyone,
I am using a PDF format of CFReport Builder to build invoicing reports for an application we use with our clients to track support tickets. The description of both the support issue and work done on the application are in Rich Text format so they have HTML tags around them. CFReport Builder apparently doesn't like HTML tags, because it shows the HTML tags. Is there a way to have report builder actually format the data by the tags?
I am using a PDF format of CFReport Builder to build invoicing reports for an application we use with our clients to track support tickets. The description of both the support issue and work done on the application are in Rich Text format so they have HTML tags around them. CFReport Builder apparently doesn't like HTML tags, because it shows the HTML tags. Is there a way to have report builder actually format the data by the tags?
#3
Re: Using HTML in CFReport Builder data
Posted 18 October 2009 - 09:22 AM
Craig328, on 14 Oct, 2009 - 12:24 PM, said:
Beats me but there are scripts out there you can set up as functions to strip all the HTML elements out of a string. Try looking at cflib.org for such. Strip the strings before you send them to the report builder and you should be on your way.
That is how I have it working right now, but the problem is that this project is for sending out invoices to our clients.
So a nice work description that look like:
Work Done:
- Fixed Joe's software issue
- Fixed DreamInCode website error
- Repaired John's hardware issue
Now looks like this:
Work Done:Fixed Joe's software issueFixed DreamInCode website errorRepaired John's hardware issue.
You can see which a client would rather see, especially if they have to delegate where the funds come from for paying my company.
#4
Re: Using HTML in CFReport Builder data
Posted 05 November 2009 - 09:56 AM
Ever have any luck with this? I'm going nuts trying to put html into my cfreport.
#5
Re: Using HTML in CFReport Builder data
Posted 05 November 2009 - 10:13 AM
#6
Re: Using HTML in CFReport Builder data
Posted 05 November 2009 - 01:05 PM
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.
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:
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!
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;,&,<,>,« , »,œu,Œ,...,œ,€,',Æ,Á,Â,À ,Å,Ã,Ä,Ç,Ð,É,Ê,È,Ë,Í,Î,Ì,Ï,Ñ,Ó,Ô,Ò,Ø,Õ,& Ouml;,Þ,Ú,Û,Ù,Ü,Ý,á,â,æ ,à,å,ã,ä,ç,é,ê,è,ð,ë,í,î,ì,ï,ñ,ó,ô,ò,ø,& otilde;,ö,ß,þ,ú,û,ù,ü,ý,ÿ, ¡,£,¤,¥,¦,§,¨,©,ª,«,¬ ,­,®,¯,°,±,²,³,´,µ,¶,· ,¸,¹,º,»,¼,½,¾,¿,×,&divi de;,¢,&##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 post has been edited by armyCoder: 05 November 2009 - 01:08 PM
#7
Re: Using HTML in CFReport Builder data
Posted 11 December 2009 - 04:01 PM
@armycoder
In theory it sounds like it should work. I will try it next time i am in the office.
In theory it sounds like it should work. I will try it next time i am in the office.
#8
Re: Using HTML in CFReport Builder data
Posted 19 March 2012 - 12:09 AM
armyCoder, 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.
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:
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!
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;,&,<,>,« , »,œu,Œ,...,œ,€,',Æ,Á,Â,À ,Å,Ã,Ä,Ç,Ð,É,Ê,È,Ë,Í,Î,Ì,Ï,Ñ,Ó,Ô,Ò,Ø,Õ,& Ouml;,Þ,Ú,Û,Ù,Ü,Ý,á,â,æ ,à,å,ã,ä,ç,é,ê,è,ð,ë,í,î,ì,ï,ñ,ó,ô,ò,ø,& otilde;,ö,ß,þ,ú,û,ù,ü,ý,ÿ, ¡,£,¤,¥,¦,§,¨,©,ª,«,¬ ,­,®,¯,°,±,²,³,´,µ,¶,· ,¸,¹,º,»,¼,½,¾,¿,×,&divi de;,¢,&##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

Page 1 of 1