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

Conditionally Suppress

Status
Not open for further replies.

smatthews

IS-IT--Management
Jul 27, 2001
108
US
Hello,

I need to create report that prints out a home address if a person has one or verbage and lines requesting the info if they do not. The problem is there could be multiple address records for one individual distinquished by a description field, for example, home address, work address, etc. What would be the easiest way to do this? Thanks in advance for your help!
 
Group by the person.

a formula like this should do:

If isnull({table.address}) or {table.address} = "" then
"Address info requested for " + {table.addresstype}
else
{table.address}

-k kai@informeddatadecisions.com
 
I would group the multiple addresses by person, and then sort them so that the Home Address, if it exists, is last. Hide the Details and GH.

Then you can have two group footers, one that prints the Address, another the prints the message. Suppress the message section using:

{Field} = "home"

Suppress the address using

{Field} <> &quot;home&quot; Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Thanks for your help. I was more familiar with the second suggestion so I tried it and it does work but there are a total of four different address types each having their own record and they all print out. The conditional suppress and print work for the particular address I am looking for, but it still shows the other three addresses. I created two groups, the first one by the person's ID number, the second is by the address identifier, for example, 'Home Address'. I sorted the addresses so the Home Address is last. Then I conditionally suppressed two Group Footer #2 sections depending on whether they have a Home Address or not. Can you see that I have done something wrong? Thanks again.
 
Sorry, I though you wanted to ask for addresses for all types, if it's just for Home:

In the record selection criteria use:

{table.AddressType} = &quot;Home&quot;

Now the rows are limited to only Home addresses

You probably don't even need to group.

@display formula:
If (isnull({table.address}) or {table.address} = &quot;&quot;)
then
&quot;Address info requested for &quot; + {table.addresstype}
else
{table.address}

-k kai@informeddatadecisions.com
 
kai,

if he uses record selection he will lose the records that don't have a home address record. He wants to keep them and print a message.

smatthews,
If all of the addresses are printing then you didn't hide the details. Move the address fields to the group footer and hide the details. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top