Crystal Reports - sub report need to show value multiple locations

Have a main report that is grouped by productID and sub report that looks up the "locationid".  

The product could be located in multiple locations for example:
product:1234
location: l21
location m28

I have the data showing in the sub report and reporting back to main but only showing one of the locations.  Is there a formula or something in can do in the sub to show both?  for example:  

product: 1234    Location:  L21 & M28
kelsanitAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
I assume you are displaying the location in the subreport detail section.

IN the subreport report header add a formula like
WhilePrintingRecords;
Shared StringVar strLocation;
strLocation := "";

Open in new window


IN the details use
WhilePrintingRecords;
Shared StringVar strLocation;
If strLocation = "" then
     strLocation := {LocationField}
Else
     strLocation := strLocation & "  &  " & {LocationField};
{LocationField}

Open in new window


in the main report you will display with
WhilePrintingRecords;
Shared StringVar strLocation;
strLocation

Open in new window


mlmcc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.