Print Page | Close Window

Pulling multiple values from one field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22187
Printed Date: 02 May 2024 at 9:03am


Topic: Pulling multiple values from one field
Posted By: Beso90
Subject: Pulling multiple values from one field
Date Posted: 10 Jan 2017 at 6:31am
Hello,
I'm making an inventory location report and was wondering if there's a way to pull the locations for one part in one line or as many as the list can grow..

The location is one field {TRANSLOG.LOC_DESC}
but a part can exist in multiple locations, so i want those multiple locations to be listed under the part in one line hopefully..

Please and thank you!

Regards,
Basel



Replies:
Posted By: Beso90
Date Posted: 16 Jan 2017 at 6:26am
Please?


Posted By: kevlray
Date Posted: 17 Jan 2017 at 4:34am
If I understand you correctly.  If you group by  {TRANSLOG.LOC_DESC} and in the details (with a formula).  Build a string using a global variable (I like shared variable better).  Something like this.

global stringvar locations;

if locations = '' then
locations := locations + ', ' + {location field}
else
locations := {location field}

Then in the group footer just put the global variable (in a formula)

whileprintingrecords:
global stringvar locations;

Also need a formula to reset the global variable in the group header.

global stringvar locations := '';

You probably can achieve a similar result with an array (the formulas change a little).



Print Page | Close Window