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

suppress fields not working

Status
Not open for further replies.

MegOBytes

Technical User
Dec 23, 2006
23
US
I am writing a report that includes the full address of a customer in the form:

{name}
{addr1}
{addr2}
{addr3}
{city} {state} {zip}

In most cases the second and third address fields are blank so i want to suppress them and move the rest of the fields up. I have checked the suppress box on the field format screen and entered the following condition for both field {addr2} and {addr3}:

isnull({addr2}) or length(trim({addr2})) = 0

(same rule for addr3 except I changed the field name to {addr3}).

I have also tried inserting the field into a text object then checking the "suppress embedded blank field lines"
that does not work either.

The third alternative - separate sections for each field - is viable but does not appear to be the most efficient way.

My question/problem - the fields may be suppressed but they do not go away and the remaining fields do not move up. Is that how suppress is suppossed to work? If you use the suppress command on a section the entire section goes away (if the condition is met).

Crystal v11 Enterprise



Rick Piekos
Massachusetts
 
Seperate sections is the most effecient way - failing that for a clean address line use a subreport for the address section.

This is sometimes a better option as it then means you can re-use the subreport in any other reports designed in letter format etc.

'J

CR8.5 / CRXI - Discovering the impossible
 
Crystal is doing exactly what you told it to do. It suppressed the field.

Separate sections for each line of address data, with "suppress blank section" checked is the way to go.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Create a formula

//@address
local stringvar addr;

if isnull({addr1} then
addr := addr
else
addr := {addr1} + chr(13);

if isnull({addr2} then
addr := addr
else
addr := addr + {addr2} + chr(13);

if isnull({addr3} then
addr := addr
else
addr := addr + {addr3};

addr

 
Thanks for the suggestions.
I am on version 11.5.9.1076

One other thing that i did not mention - the fields that i want to suppress are in the Group Header (#1a) section. I didn't know if that made a difference.

I assume that when you say that i should insert a new section you are referring to a new group hader section?
my initial header section is 1a, the new ones will be 1b, 1c, 1d, . . .

Rick Piekos
Massachusetts
 
Yes, multiple group header sections, set to suppress blank section.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I use the formula when I create addresses on my reports without resorting to separate sections.

//@address
local stringvar addr;

if isnull({addr1} then
addr := addr
else
addr := {addr1} + chr(13);

if isnull({addr2} then
addr := addr
else
addr := addr + {addr2} + chr(13);

if isnull({addr3} then
addr := addr
else
addr := addr + {addr3} + chr(13);

if isnull({city}} then
addr := addr
else
addr := addr + {city};

if isnull({state}} then
addr := addr
else
addr := addr + ", " + {state};

if isnull({zip}} then
addr := addr
else
addr := addr + " " + {zip};

addr


-lw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top