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

Combining field in formulas

Status
Not open for further replies.

zwieback89

Programmer
Mar 8, 2001
42
US
Hi,

How do I insert a line break after line 1 and line 2 fields ? THe reason why I am doing this is so that the fields that have null values are ignored and replaced with a space rather than having huge spaces for the null values.

Please do return back to me with a suggestion for inserting a line break, i.e., the field value line 2 should come on the next line instead of the same line.

// -- start of formula --------------------------------------------
// use always a LocalVar; CR is a bit buggy
Local StringVar Address := "";

//append line 1 if line 1 is given
if not(isNull({web_PersonalAddress.line1}))
then Address := {web_PersonalAddress.line1};

//append line 2 if line 2 is given
if not(isNull({web_PersonalAddress.line2}))
then Address := {web_PersonalAddress.line2};

// append City if City is given
if not(isNull({web_PersonalAddress.city}))
then Address := {web_PersonalAddress.city};

// append County if County is given
if not(isNull({web_PersonalAddress.county}))
then Address := Address + ", " + {web_PersonalAddress.county};

// append State if State is given
if not(isNull({web_PersonalAddress.State}))
then Address := Address + ", " + {web_PersonalAddress.State};

// append ZIP code if ZIP code is given
if not(isNull({web_PersonalAddress.zip}))
then Address := Address + ", " + {web_PersonalAddress.zip};

Hope to hear soon on this.
Padmaja.
 
Use CHR(13) in your formula for a line feed.

Or you could put each line on a subsection of CR, and use the "Suppress Blank Section" format option for that subsection. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top