Skip to main content
Participant
November 22, 2011
Question

help on html code to excel format

  • November 22, 2011
  • 2 replies
  • 703 views

i have try to do a html table  to excel, but 1 of the query data it content a <span class> tag(i use this in the code), when i export to excel it will also show that code into the excel cell.

so if there a way to format that cell so it only show the data but not the <span>?

iam use the cfspreadsheet tag.

thanks

    This topic has been closed for replies.

    2 replies

    f7878Author
    Participant
    November 22, 2011

    umm well now the problem is the table is work find in the IE the data show the line between each name in 1 "cell"  1 by 1(from top to bottom), but when i use cfspreadsheet to output that , the cell which have the data will just show

    <span class="head"> name </span> <br><span class="text" >... ... etc

    so is that my original code from .cfc have problem or it just the <cfspreadsheet> cant convert that?

    Inspiring
    November 22, 2011

    <cfspreadsheet> takes a query and converts the structure of the query to a spreadsheet. I don't believe it does any interpretation of the formatting or styles of the cell data from HTML code contained within the query fields (think: raw content).  If you want to keep only the data and remove the formatting, I think that you'll have to use another method (e.g. Regular Expressions) to do that.

    Inspiring
    November 22, 2011

    You can probably find a regular expression that you can use to strip out the HTML tags and leave just the content (check google). Once you find it, you can use reReplaceNoCase to remove the extraneous markup