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!

Tight Horizontal format editor setting

Status
Not open for further replies.

Jacque

Technical User
Nov 9, 2001
301
US
Crystal v9.0, sybase,
Hi everyone, TGIF! [auto]

This is what I'm trying to accomplish:

All text, db fields and formulas placed in my report are formatted with the Tight Horizontal setting set on so that the object resizes to the size of the text, field data or formula result. This works great if I've originally set the object width large enough but if the original width of the object is not as long as the longest data/text displayed in the field/formula, the field will not resize larger than the initial width set.

I'd like to set text which truncates the display because of the object width not large enough to crred to visually make these issues easily noticeable. Is this possible?

Hopefully this makes sense, thanks! TGIF
Jacque
 


I have not worked with version 9 yet, and version 8.5 does not have a "tight" fiction. However, it does have a check box in the general properties that says "can grow". This has been very usefull in dynamically allocating space for data.

right click field, General Tab, approximately in the middle (in version 8.5) is the "can grow" check box
 
Hi EvilSock,
Can grow only works for vertical growth and what I need to validate and account for is horizontal growth.
Thanks though,
cool name btw.
Jacque
 


I don't know if this will help you, but here is some code to tell you how big a field is.

formula: checkSize

WhileReadingRecords;
shared numberVar maxLen;
local numberVar currLen;
local numberVar prevLen;

currLen := Length(ToText({myField}));

If (OnFirstRecord) Then
prevLen := currLen
Else
prevLen := Length(ToText(Previous({myField})));


maxLen := IIF(prevLen<currLen, currLen, prevLen);

// now maxLen has the length of the longest field in your report. If you can specify a default length somewhere this would be usefull... if you can't, then this won't help you much.
 
Hi EvilSock,
I tried your code and get the following error message:
The (OnFirstRecord) is highlighted
Error msg: This function cannot be used because it must be evaluated later.

I'm not sure I understand your statement &quot;If you can specify a default length somewhere this would be usefull...&quot; Where would I specify the default length?

Thanks for your help and patience.
Jacque




 
I fixed the error message by using whileprintingrecords. I'll have to play with incorporating the formula to see how to best use it to suit my needs.

Thanks EvilSock,
Have a good weekend.
Jacque
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top