Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field length in Measurement NOT Chars 2

Status
Not open for further replies.

tav1035

MIS
May 10, 2001
344
US
I have a description field that I want to show about 3 inches of data only. However, I would like to not cut off the description unless I add ... to indicate to the users that there are more information in the field that is not visible on the report.
I started using this formula to do exactly that.
Code:
If Length ({WORKORDER.DESCRIPTION})>37 then Left({WORKORDER.DESCRIPTION},38) &'...' else {WORKORDER.DESCRIPTION}

The problem is that some users are using CAPS, some are using lower case and some are using Sentence Case. This puts my length all over the place, but works.

[red]Look at the wasted real-estate between the dotted lines [/red]

DescriptionLength.gif


Is there any other cool ideas to get maximum visibility without word wrapping and still appending my ... is an indicator.

thanks
tav
 
You could create a formula that converts the description field to proper case:

ProperCase({Table.Description})

This would make the descriptions consistant in format on the report. However, depending on the font you are using, you may not be able to maixmize the space used on every line.

MrBill
 
If you use a nonproportional font like "Courier New", the upper vs lower case won't matter.

-LB
 
These both are great ideas and I tried them both, but there are down falls to both....
ProperCase works well except for where there are abreviations in the descriptions like CIC or CIMP etc. They appear to be a mispelled work like Cic or Cimp.

Courier uses alot of room. I could not get the font small unless I used "courier new". If I used this font, I would apply it to the whole report and I'm already hurting for more room.

I will have to think on this. I would ultimately like to have something that counts the number of uppercase and subtracts that from the original formula
like->
Code:
If Length ({WORKORDER.DESCRIPTION})>37 then Left({WORKORDER.DESCRIPTION},38) &'...' 
else {WORKORDER.DESCRIPTION}

If Length UpperCase({WORKORDER.DESCRIPTION})>1 then (count)
 Left({WORKORDER.DESCRIPTION},45-(count)) &'...' 

else {WORKORDER.DESCRIPTION}
thanks
tav
 
You will not get consistent lengths unless you use a nonproportional font--whether or not you convert the case.

-LB
 
Anyone, still looking for ideas on this or proper syntax for the code in my last post.
Thanks,
tav
 
As lbass says, you won't be able to work out lengths in a non-proportionate font. It won't spot the difference between www and iif, for instance.

It would be nice if some future version of Crystal / BO did include an option to work out the printed length of a bit of text in a particular font. Until then, I'd figure it is impossible within Crystal.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top