Solved

Coldfusion MX7-  how to truncate output data?

Posted on 2007-11-14
4
1,612 Views
Last Modified: 2010-04-21
I have a results/detail page set and on my results page I have a field called remarks which is typically very lengthy 500 characters or more, I want to be able to show a preview of the remarks on my results page, limiting the ouput to 100 characters. How can this be accomplished?

Many Thanks!
0
Comment
Question by:Bang-O-Matic
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
erikTsomik earned 300 total points
Comment Utility
try something like this


<cfoutput>#left(Comment,100)#</cfoutput>

Open in new window

0
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
You might also be interested in one of the functions at cflib.org: FullLeft().  It won't chop off the text in the middle of a word.
http://cflib.org/udf.cfm?id=329&enable=1
0
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 200 total points
Comment Utility
Another good function is:  

FormatTeaser()
http://cflib.org/udf.cfm?ID=832
..  display n number of characters from a string with out cutting of in the middle of the word. The function will display a link at the end of the string if it is longer than the number of characters desired ..
0
 

Author Closing Comment

by:Bang-O-Matic
Comment Utility
Thanks for the help!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now