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

Suppressing a Address line if blank 2

Status
Not open for further replies.

gscheepers

IS-IT--Management
Jan 21, 2002
150
0
0
US
Hi,

I would like to know how suppress a Address field if it's blank. At the moment I have 4 address fields, but they are not all used all the time which means that there's a blank line.

Thanks. Gerhard Scheepers
BA - LETEC
 
Create four sub-sections in your detail section.
Place each line of the address in a sub-section.
For the sub-sections that may be blank, use the "suppress" property in the section expert with the following conditional formula (the "X+2" button):

isnull({table.field})

This will work if you have NOT check "convert null fields to default" in the report options. if you have then use:

length(trim({table.field})) = 0

Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
I havent done this so I am not sure but I saw a post that said you can embed your address lines inside of a text box and then you can set the text box to suprress embedded field blank lines.

The way to do it is to put it all in your text box, format editor, common, and check the box for "suppress enbedded field blank lines"..

However, I am not sure if this will work for NULLS and when I have this issue I use the solution that Howard explained above.

LMC
cryerlisa@hotmail.com
 
this is a reat of an older post....I think you should get the idea from this:

********************************************************

I would use the same one formula approach but slightly different...I would build the expression...rather than try to guess the combinations

stringvar result := "";

if not isnull({?Parm1}) and length(trim({Parm1})) <> 0 then
result := result + &quot;desc1 : &quot; + {?Parm1} + space(10);

if not isnull({?Parm2}) and length(trim({Parm2})) <> 0 then
result := result + &quot;desc2 : &quot; + {?Parm2} + space(10);

if not isnull({?Parm3}) and length(trim({Parm3})) <> 0 then
result := result + &quot;desc3 : &quot; + {?Parm3} + space(10);

if not isnull({?Parm4}) and length(trim({Parm1})) <> 0 then
result := result + &quot;desc4 : &quot; + {?Parm4} ;

result;

the same principle is used for building blank-line-addresses

hope this helps....Jim

PS: embedding fields in text boxes can REALLY slow down your report....make formulas they are faster and easier to maintain

**********************************************************

Hope this helps.....Jim
 
not only that - I tried this and it will NOT handle the nulls (embedded fields) so I would definitely go with a formula or the example I gave above...

lmc
cryerlisa@hotmail.com
 
Hi,
Adding address line fields to a text box works fine.

The only restricton is that you do not used formulae on fields that may be null.

Geoff
 
What version? I am new to Crystal.
I just format the section for the (separate)address lines to &quot;Suppress if blank&quot;.
Is this function available in versions pervious to 8.5? Or am I missing something?
Thanks (-:
Karen
 
Hi Karen,

You can add each address field to separate lines within a single text box field.

You then just tick the suppress blank lines in text box format options.

Hth,
Geoff

PS. Using separate detail sections is ideal for labels.
 
Perhaps a simple way is the following


If isnull({Address2}) then {Address 1} else
{address 1} + chr(13) + {address2}

and continue on the logic

The chr(13) is a carriage return

Training jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top