0

I am working on a report in Crystal Reports 2016. The table used by the report, USER_ADDR, stores the addresses in its ADDRESS column, storing additional information about the address (ex: apartment #) in a second line.

USER_ADDR Table

ACCOUNT_ID ADDRESS_LINE ADDRESS
1 1 1234 Orange Ln
2 1 1259 Apple Dr
2 2 APT 209
3 1 4962 Kiwi Pl

I am using the field USER_ADDR.ADDRESS to show the address, but it only shows the first address line, which does not show the complete address if an account has an ADDRESS_LINE of 2.

  1. How would I go about making a formula in Crystal Reports to show all lines of the ADDRESS column when an ACCOUNT_ID has an address where ADDRESS_LINE = 1 and 2.

or

  1. How would I make a formula that only includes an ACCOUNT_ID's address where ADDRESS_LINE = 2

For reference, the report I'm modifying has the below columns:

Account Address Line 1 Address Line 2

Thank you!

What I've tried: opened the Format Editor and selected the "Can Grow" option, hoping that would allow ADDR.ADDRESS to be multi-line but that did not work.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kelly
  • 1
  • 1

1 Answers1

0

Use a detail-level formula to declare a global string variable and append the information using Chr(10) + Chr(13) to inject new lines. Reset the variable in the group header. Display the result in the Group footer. Suppress the detail section.

MilletSoftware
  • 3,521
  • 2
  • 12
  • 15