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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for formula or way

Status
Not open for further replies.

sjp0362

Technical User
Oct 23, 2004
48
US
Working in Crystal 9.2

I have a text field that contains three fields on two lines.
{1FirmName}
{2FirstName} {3LastName}

The size for this text field on my report is currently one line high and has the ability to grow.

What I don't like about this is that sometimes the {1FirmName} returned is long and wraps to a second line, so when the report prints, I end up with three lines high. But I do like the fact that when these fields are null, my line height stays at one line high.

I want to keep {1FirmName} limited to one line and {2FirstName} {3LastName} limited to one line; and I also want to make it so that if there isn't any information in these three fields, the space on the report is only one line high.

I've thought about using the "trim" formula, but with characters like m's and w's taking up so much more room than i's and l's, sometimes the printout for these firm names looks way out of proportion to other firm names.

Any ideas out there?
 
Given your criteria, you can either uncheck "can grow" to prevent the wrapping or you could change the font size conditionally depending upon the length of the names, e.g.,

if len({table.firmname}) > 40 then 6 else
if len({table.firmname}) > 30 then 8 else 10

I just plugged in the font size, but you can adjust as necessary based on the length you want to use. This works best if you also use a non-proportional font like Courier New.

-LB
 
I don't want to uncheck the "can grow", because I only want to take up one line height worth if these fields are all "null".

I do like the idea of changing my font size for the longer length firm names though and will give that a try.

Thanks!
 
Can grow has nothing to do with nulls. If you want to maintain the line height, go to the section expert->uncheck "suppress blank section" for each section. I'm assuming you have these in detail_a and detail_b. If not, you should put them there.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top