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

formula in the 'Can Grow' option in Format field 2

Status
Not open for further replies.

dawnyanne

Technical User
Nov 1, 2006
34
GB
Hi

Has anyone used a formula in the Can Grow option in format field?

What I need to do is limit a box to 54 lines - and if the text goes over the 54 lines - go to the next page. If I just say Can grow to 54 lines - if there is more text than this it just cuts it off! Oh for a 'linecount' formula/function in Crystal v 8.5!!!

any help would be much appreciated

kind regards

dawnyanne
 
to add this problem the field that I am using is of 'Memo' type - so I cant use a variable to work out the number of lines in the field! grr!

Many thanks for any help

dawnyanne
 
You can use Length({your.field}). This will give a good aproximation.

It is possible to count lines indireclty, by adding for several sections using variables. But this does not count printed lines in a box

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi

Thank you so much for coming back to me.

The field I am looking at is a MEMO field - so I cant seem to use this field in a formula - Is there any way around this?

Thank you so, so much for your help - it is very much appreciated.

take care

dawnyanne
 
Sorry, no experience with MEMO fields. Can anyone else help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You can work with memo fields in 8.5 if you set up a SQL expression {%memo}. You will have to type in the field name, as memo fields won't appear on the field list. Try either:

substr(table.`memo`,1,254)

Or:

{fn substring(table.`memo`,1,254)}

Substitute your actual table.field name, using the appropropriate punctuation (insert another field to see how to punctuate, and then delete it).

I don't know of a way to count lines within a text box, other than to use length. If you used a nonproportional font like Courier New, you could come close to a total line count per box by using a formula like:

len({%memo})/<number of characters per line>

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top