Skip to main content
Participant
August 16, 2006
Question

Long Text Retrieval

  • August 16, 2006
  • 3 replies
  • 371 views
Is there a way to retrieve formatted long text fields from MSSQL using <cfoutput> in ColdFusion? I'm particulary interested in showing linefeeds/carriage returns. The data is retrieved as one long string. When I retrieve the data in a <textarea> the formatting is correct.


This topic has been closed for replies.

3 replies

Lisa_Z_Author
Participant
August 17, 2006
Found the solution:

<cfoutput>#ParagraphFormat(retrieved_data)#</cfoutput>

This restores linefeeds/carriage returns during output.


BKBK
Community Expert
Community Expert
August 16, 2006
It would be helpful to let us have more details. One should know the relationship between the result set of the query and "retrieved_data". For example, if the query returns ten rows, your code will create ten forms, which doesn't seem like what you want.

Lisa_Z_Author
Participant
August 16, 2006
I'm using test data that has only one row. The code is just to show you what I'm doing.

<cfoutput>#retreived_data# results:
"Mary had a little lamb. It's fleece was white as snow."

<cfoutput> into textarea results:
"Mary had a little lamb.

It's fleece was white as snow. "

Sorry I was not clear enough.
Inspiring
August 16, 2006
replace chr(10) with <br>
Lisa_Z_Author
Participant
August 16, 2006
Thanks Dan! I'm not quite sure how to do this within text output. Any suggestions?

Lisa Z.