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

Force Carriage Return in Formula

Status
Not open for further replies.

MrTBC

Technical User
Nov 19, 2003
610
US
Crystal 8.5 Progress Database

Is there a way to force a carriage return in a formula in Crystal (i.e. the equivalent of the "vbcr" contstant in VBA).
I want to create a formula that presents an Address on a report that is derived from 5 separate fields (Address1, Address2, Town, County, PostCode) as a four or five line address, depending on whether Address Line 2 is blank or complete.
If I do this by putting the actual fields into the report then I get an ugly blank line in some addresses for Address2.

Thanks for your help.
 
The easiest method of doing this would be to create new a Text object on the report. Drop the Address1 field in, hit [ENTER], then put Address2 on the next line, etc...
When you're done, you'll have one big text object with all of your fields.

Then, right click on the field object, go to Format Text, and at the bottom of the Common tab, check the box next to "Suppress Embedded Field Blank Lines". This will keep you from having blank lines.

-dave
 
Put Customer Name and Address 1 in one section (I assum this would be a group header but it really doesn't matter)
Put Address 2 in a second group header section
Put City, State and Zip in a third group header section.

Format the middle section (for Addess 2 which is sometimes blank) to suppress blank section.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
You could use

chr(13) in the formula - this will give a new line

and then on the format the text box to Suppress Embedded Field Blank Lines

 
Thanks guys - lots of different ways of doing this then!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top