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!

expand or move a field

Status
Not open for further replies.

jayy66

Programmer
Aug 21, 2006
56
0
0
US
I have a crystal report that has two fields loaded from a
database onto the report like so:
[ {field1} {field2} ]

I need to write a formula that will move or expand field2 in the place of field1 if field1 is null.

For example if field1 is null the report would look like this:
[ {field2} ]

or, if possible like this:
[ {field2 } ]

Im new to crystal reports so any help would be appreciated.

Thanks


Some additional information: Im using crystal reports 9 and basic syntax
 
OK, so what happens if field 1 is not null, do you show both fields? Please take the time to clarify requirements.

Anyway, this theory should help:

if isnull({table.field1}) then
{table.field2}
else
{table.field1}

Then in the position for field 2 use the following formula:

if isnull({table.field1}) then
""
else
{table.field2}

This assumed that you want to display field 2 when field 1 is available, of course this is an assumption, if I'm mistaken, try posting the full requirements.

-k
 
Thanks for the reply.
Yes if both fields are not null I want to display both fields side by side.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top