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

Resizing fields on condition

Status
Not open for further replies.
Jul 11, 2005
2
US
Using Crystal Reports 8, I have a formula field that needs to shrink to fit the space allocated, how can I resize the field so that the data wont get truncated.
 
Makes no sense, you say that you want to shrink a formula field, then say that you want to prevent it from getting truncated. You can't shrink a formula field, however you can underlay multiple formula fields and conditionall suppress all that aren't applicable, or you can adjust the size of a font in a single formula field.

Here's the size of the font example:

Fonts can be conditional, but keep in mind that most Windows fonts are proportional, so you'll be guessing about the shrinkage.

Right click the field and select format field->Font->X2 next to Size and then use a formula such as:

if len(trim({table.field})) < 6 then
14
else
if len(trim({table.field})) < 8 then
12
if len(trim({table.field})) < 10 then
10
else
8

-k
 
That sounds almost right for what I need, here is my problem, I want to know if there is a way to maipulate the fiels as if it were a picture, to either stretch it or shrink it so that the text wont get truncated but that the space I need for the text is always ocupied. example:

L U I S
GURRUMINAS

I hope this makes sense.

Thank You
 
Ummm, no, that doesn't help me understand it unless you mean that you want to place spaces between the characters to keep the field at a constant length.

You cannot conditionally stretch or shrink tohe field itself, however you can have several of them laying over the top of each other and conditionally suppress, as in:

Field 1 suppression:
len(trim({table.field})) <= 3

Field 2 suppression:
len(trim({table.field})) > 3
and
len(trim({table.field})) <= 6

Field 3 suppression:
len(trim({table.field})) > 6
and
len(trim({table.field})) <= 9
...etc...

Try stating specifically what it is that you want, keeping in mind that fields won't stretch, however they can grow (will drop down to the next line), or you can change fonts or have multiple fields overlapping, or perhaps you want to insert spaces between the actual characters.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top