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

Big question

Status
Not open for further replies.

EMax1

MIS
Apr 8, 2004
95
US
I am new at this, but I have the following problem
I have 3 fields on a report (City, State, and Zip); I vould like to combine those to avoid a space between them.
I guess it is easy to do, but I cannot find How.
Thanks in advance.
 
One option is to insert a text object and drag these fields into the text object (typing a space between them).

Another option is to create a formula such as:
{city} + ", " + {state} + " " + {zip}

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Since you're speaking of addresses, I'll speak to the topic as a whole, as Ido's solutions are good.

In general people have multiple address lines, so right click the details section and select insert section below for however may lines yours has, such as:

Name
Add1
Add2
City ST, ZIP

Now right click each section and select section expert (version dependent, please remember to include basic information in posts), and select suppress blank section.

Now you won't receive any blank lines except the city state zip because it always includes a comma. To fix this, in the X2 next to suppress place:

isnull({table.city})
or
TRIM({table.city}) = ""

Another means, and slightly faster than Ido's solutions would be to create a SQL Exdpression so that the database creates the City, ST ZIP field for you, but this is database dependent.

-k
 
City, State ZIP is typically a 1-line affair, but multiple address line cases are indeed a common issue as well.

My prefered solution for those is to simply insert the address line fields in a single Text object. If you right-click the Text object, and select 'Format Text', one of the formatting options is: "Suppress Embedded Field Blank Lines". This achieves the same effect without requiring multiple sections.

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top